Skip to content

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.

csharp
DmColumn()

DmColumn ​

Initializes a new instance of the MJCZone.DapperMatic.Models.DmColumn class with the specified parameters.

csharp
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 ​

MethodSummary
IsNumericDetermines whether the column is numeric.
IsTextDetermines whether the column is text.
IsDateTimeDetermines whether the column is a date/time type.
IsBooleanDetermines whether the column is a boolean type.
IsBinaryDetermines whether the column is a binary type.
IsGuidDetermines whether the column is a GUID type.
IsEnumDetermines whether the column is an enum type.
IsArrayDetermines whether the column is an array type.
IsDictionaryDetermines whether the column is a dictionary type.
IsEnumerableDetermines whether the column is an enumerable type.
GetTypeCategoryGets the type category of the column.
ToStringReturns a string representation of the column definition.
GetProviderDataTypeGets the provider data type for the specified provider.
SetProviderDataTypeSets the provider data type for the specified provider.
GetType
Equals
GetHashCode

IsNumeric ​

Determines whether the column is numeric.

csharp
bool? IsNumeric()

Returns ​

Type: bool?

if the column is numeric; otherwise, .

IsText ​

Determines whether the column is text.

csharp
bool? IsText()

Returns ​

Type: bool?

if the column is text; otherwise, .

IsDateTime ​

Determines whether the column is a date/time type.

csharp
bool? IsDateTime()

Returns ​

Type: bool?

if the column is a date/time type; otherwise, .

IsBoolean ​

Determines whether the column is a boolean type.

csharp
bool? IsBoolean()

Returns ​

Type: bool?

if the column is a boolean type; otherwise, .

IsBinary ​

Determines whether the column is a binary type.

csharp
bool? IsBinary()

Returns ​

Type: bool?

if the column is a binary type; otherwise, .

IsGuid ​

Determines whether the column is a GUID type.

csharp
bool? IsGuid()

Returns ​

Type: bool?

if the column is a GUID type; otherwise, .

IsEnum ​

Determines whether the column is an enum type.

csharp
bool? IsEnum()

Returns ​

Type: bool?

if the column is an enum type; otherwise, .

IsArray ​

Determines whether the column is an array type.

csharp
bool? IsArray()

Returns ​

Type: bool?

if the column is an array type; otherwise, .

IsDictionary ​

Determines whether the column is a dictionary type.

csharp
bool? IsDictionary()

Returns ​

Type: bool?

if the column is a dictionary type; otherwise, .

IsEnumerable ​

Determines whether the column is an enumerable type.

csharp
bool? IsEnumerable()

Returns ​

Type: bool?

if the column is an enumerable type; otherwise, .

GetTypeCategory ​

Gets the type category of the column.

csharp
string GetTypeCategory()

Returns ​

Type: string

The type category of the column.

ToString ​

Returns a string representation of the column definition.

csharp
string ToString()

Returns ​

Type: string

A string representation of the column definition.

GetProviderDataType ​

Gets the provider data type for the specified provider.

csharp
string? GetProviderDataType(DbProviderType providerType)

Parameters ​

Returns ​

Type: string?

The provider data type for the specified provider.

SetProviderDataType ​

Sets the provider data type for the specified provider.

csharp
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 ​

csharp
void GetType()

Equals ​

csharp
void Equals()

GetHashCode ​

csharp
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?