Table of Contents

Class DataTypeAttribute

Namespace
LinqToDB.Mapping
Assembly
linq2db.dll

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 DataType

linq2db column type name.

DataTypeAttribute(DataType, string)

Creates attribute instance.

public DataTypeAttribute(DataType dataType, string dbType)

Parameters

dataType DataType

linq2db column type name.

dbType string

SQL column type name.

DataTypeAttribute(string)

Creates attribute instance.

public DataTypeAttribute(string dbType)

Parameters

dbType string

SQL column type name.

Properties

DataType

Gets or sets linq2db type of the database column.

public DataType? DataType { get; set; }

Property Value

DataType?

DbType

Gets or sets the name of the database column type.

public string? DbType { get; set; }

Property Value

string

Methods

GetObjectID()

Returns mapping attribute id, based on all attribute options.

public override string GetObjectID()

Returns

string