DmColumn ​
Namespace: MJCZone.DapperMatic.Models
Assembly: MJCZone.DapperMatic
Summary ​
Represents a database column with various properties and methods to determine its characteristics.
public
Contents ​
Constructors (2) | Methods (17) | Properties (22)
Constructors ​
DmColumn ​
Initializes a new instance of the MJCZone.DapperMatic.Models.DmColumn
class.
DmColumn()
DmColumn ​
Initializes a new instance of the MJCZone.DapperMatic.Models.DmColumn
class with the specified parameters.
DmColumn(string schemaName, string tableName, string columnName, Type dotnetType, DbProviderType providerDataTypes, String} length, Int32} precision, Int32} scale, Int32} checkExpression, string defaultExpression, string isNullable, bool isPrimaryKey, bool isAutoIncrement, bool isUnique, bool isUnicode, bool isIndexed, bool isForeignKey, bool referencedTableName, string referencedColumnName, string onDelete, DmForeignKeyAction} onUpdate)
Parameters ​
- schemaName (string) - The schema name.
- tableName (string) - The table name.
- columnName (string) - The column name.
- dotnetType (Type) - The .NET type of the column.
- providerDataTypes (DbProviderType) - The provider data types.
- length (String}) - The length of the column.
- precision (Int32}) - The precision of the column.
- scale (Int32}) - The scale of the column.
- checkExpression (Int32}) - The check expression.
- defaultExpression (string) - The default expression.
- isNullable (string) - Indicates whether the column is nullable.
- isPrimaryKey (bool) - Indicates whether the column is a primary key.
- isAutoIncrement (bool) - Indicates whether the column is auto-incremented.
- isUnique (bool) - Indicates whether the column is unique.
- isUnicode (bool) - Indicates whether the column explicitly supports unicode characters.
- isIndexed (bool) - Indicates whether the column is indexed.
- isForeignKey (bool) - Indicates whether the column is a foreign key.
- referencedTableName (bool) - The referenced table name.
- referencedColumnName (string) - The referenced column name.
- onDelete (string) - The action on delete.
- onUpdate (DmForeignKeyAction}) - The action on update.
Methods ​
Method | Summary |
---|---|
IsNumeric | Determines whether the column is numeric. |
IsText | Determines whether the column is text. |
IsDateTime | Determines whether the column is a date/time type. |
IsBoolean | Determines whether the column is a boolean type. |
IsBinary | Determines whether the column is a binary type. |
IsGuid | Determines whether the column is a GUID type. |
IsEnum | Determines whether the column is an enum type. |
IsArray | Determines whether the column is an array type. |
IsDictionary | Determines whether the column is a dictionary type. |
IsEnumerable | Determines whether the column is an enumerable type. |
GetTypeCategory | Gets the type category of the column. |
ToString | Returns a string representation of the column definition. |
GetProviderDataType | Gets the provider data type for the specified provider. |
SetProviderDataType | Sets the provider data type for the specified provider. |
GetType | |
Equals | |
GetHashCode |
IsNumeric ​
Determines whether the column is numeric.
bool? IsNumeric()
Returns ​
Type: bool?
IsText ​
Determines whether the column is text.
bool? IsText()
Returns ​
Type: bool?
IsDateTime ​
Determines whether the column is a date/time type.
bool? IsDateTime()
Returns ​
Type: bool?
IsBoolean ​
Determines whether the column is a boolean type.
bool? IsBoolean()
Returns ​
Type: bool?
IsBinary ​
Determines whether the column is a binary type.
bool? IsBinary()
Returns ​
Type: bool?
IsGuid ​
Determines whether the column is a GUID type.
bool? IsGuid()
Returns ​
Type: bool?
IsEnum ​
Determines whether the column is an enum type.
bool? IsEnum()
Returns ​
Type: bool?
IsArray ​
Determines whether the column is an array type.
bool? IsArray()
Returns ​
Type: bool?
IsDictionary ​
Determines whether the column is a dictionary type.
bool? IsDictionary()
Returns ​
Type: bool?
IsEnumerable ​
Determines whether the column is an enumerable type.
bool? IsEnumerable()
Returns ​
Type: bool?
GetTypeCategory ​
Gets the type category of the column.
string GetTypeCategory()
Returns ​
Type: string
The type category of the column.
ToString ​
Returns a string representation of the column definition.
string ToString()
Returns ​
Type: string
A string representation of the column definition.
GetProviderDataType ​
Gets the provider data type for the specified provider.
string? GetProviderDataType(DbProviderType providerType)
Parameters ​
- providerType (DbProviderType) - The provider type.
Returns ​
Type: string?
The provider data type for the specified provider.
SetProviderDataType ​
Sets the provider data type for the specified provider.
DmColumn SetProviderDataType(DbProviderType providerType, string providerDataType)
Parameters ​
- providerType (DbProviderType) - The provider type.
- providerDataType (string) - The provider data type.
Returns ​
Type: DmColumn
The current instance.
GetType ​
void GetType()
Equals ​
void Equals()
GetHashCode ​
void GetHashCode()
Properties ​
SchemaName ​
Gets or sets the schema name.
Type: string?
TableName ​
Gets or sets the table name.
Type: string
ColumnName ​
Gets or sets the column name.
Type: string
DotnetType ​
Gets or sets the .NET type of the column.
Type: Type
ProviderDataTypes ​
Gets the provider data types. The FULL native provider data type. This is the data type that the provider uses to store the data (e.g. "INTEGER", "DECIMAL(14,3)", "VARCHAR(255)", "TEXT", "BLOB", etc.)
Type: Dictionary<DbProviderType, string>
Length ​
Gets or sets the length of the column.
Type: int?
Precision ​
Gets or sets the precision of the column.
Type: int?
Scale ​
Gets or sets the scale of the column.
Type: int?
CheckExpression ​
Gets or sets the check expression.
Type: string?
DefaultExpression ​
Gets or sets the default expression.
Type: string?
IsNullable ​
Gets or sets a value indicating whether the column is nullable.
Type: bool?
IsPrimaryKey ​
Gets or sets a value indicating whether the column is a primary key.
Type: bool?
IsAutoIncrement ​
Gets or sets a value indicating whether the column is auto-incremented.
Type: bool?
IsUnique ​
Gets or sets a value indicating whether the column is unique.
Type: bool?
IsUnicode ​
Gets or sets a value indicating whether the column explicitly supports unicode characters.
Type: bool?
IsFixedLength ​
Gets or sets a value indicating whether the column is of a fixed length.
Type: bool?
IsIndexed ​
Gets or sets a value indicating whether the column is indexed.
Type: bool?
IsForeignKey ​
Gets or sets a value indicating whether the column is a foreign key.
Type: bool?
ReferencedTableName ​
Gets or sets the referenced table name.
Type: string?
ReferencedColumnName ​
Gets or sets the referenced column name.
Type: string?
OnDelete ​
Gets or sets the action on delete.
Type: DmForeignKeyAction?
OnUpdate ​
Gets or sets the action on update.
Type: DmForeignKeyAction?