Class DataTypeAttribute
This attribute allows to override default types, defined in mapping schema, for current column. Also see DataType and DbType. Applying this attribute to class or interface will have no effect.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = true, Inherited = true)]
public class DataTypeAttribute : MappingAttribute, _Attribute
- Inheritance
-
DataTypeAttribute
- Implements
- Inherited Members
- Extension Methods
Constructors
DataTypeAttribute(DataType)
Creates attribute instance.
public DataTypeAttribute(DataType dataType)
Parameters
dataType
DataTypelinq2db column type name.
DataTypeAttribute(DataType, string)
Creates attribute instance.
public DataTypeAttribute(DataType dataType, string dbType)
Parameters
DataTypeAttribute(string)
Creates attribute instance.
public DataTypeAttribute(string dbType)
Parameters
dbType
stringSQL column type name.
Properties
DataType
Gets or sets linq2db type of the database column.
public DataType? DataType { get; set; }
Property Value
DbType
Gets or sets the name of the database column type.
public string? DbType { get; set; }
Property Value
Methods
GetObjectID()
Returns mapping attribute id, based on all attribute options.
public override string GetObjectID()