Interface IDataColumn
- Namespace
- Datafication.Core.Data
- Assembly
- Datafication.Core.dll
Represents a column in a data block.
public interface IDataColumn
Properties
DataType
Gets or sets the data type of the column.
SerializableType DataType { get; set; }
Property Value
DefaultValue
Gets or sets the default value of the column.
object DefaultValue { get; set; }
Property Value
- object
Description
Gets or sets the description of the column.
[DataMember]
string Description { get; set; }
Property Value
- string
A string containing a detailed description of the column's purpose and content.
Examples
IDataColumn column = new DataColumn();
column.Name = "customer_age";
column.Label = "Age";
column.Description = "The age of the customer in years at the time of registration";
Remarks
The description provides additional context about the column's purpose, content, or usage. This can be useful for documentation, generating embeddings with richer context, or providing metadata for applications that need to understand the semantic meaning of the column.
Format
Gets or sets the format string used to display or serialize the column's values.
string Format { get; set; }
Property Value
- string
A string representing the format applied to column values during rendering or serialization.
Examples
IDataColumn column = new DataColumn();
column.Format = "0.00";
Console.WriteLine(string.Format(column.Format, 12.3456)); // Output: 12.35
Remarks
The format string follows standard .NET formatting conventions. For example:
"0.00"- For two decimal places (e.g., 12.34)."yyyy-MM-dd"- For date formatting (e.g., 2024-01-01).
IsIndexed
Gets or sets a value indicating whether the column is indexed.
bool IsIndexed { get; set; }
Property Value
- bool
IsNullable
Gets or sets a value indicating whether the column allows null values.
bool IsNullable { get; set; }
Property Value
- bool
IsPrimaryKey
Gets or sets a value indicating whether the column is a primary key.
bool IsPrimaryKey { get; set; }
Property Value
- bool
Label
Gets or sets the label of the column.
string Label { get; set; }
Property Value
- string
Name
Gets or sets the name of the column.
string Name { get; set; }
Property Value
- string
Values
Gets or sets the values in the column.
List<object> Values { get; set; }
Property Value
- List<object>
Methods
Clone()
Creates a copy of the column.
IDataColumn Clone()
Returns
ToString()
Returns a string that represents the column.
string ToString()
Returns
- string
A string that represents the column.
ValidateValue(object)
Validates whether a value matches the column type.
bool ValidateValue(object value)
Parameters
valueobjectThe value to validate.
Returns
- bool
True if the value is valid; otherwise, false.