Class PrimaryKeyAttribute
Marks property or field as a member of primary key for current mapping type.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = true)]
public class PrimaryKeyAttribute : MappingAttribute, _Attribute
- Inheritance
-
PrimaryKeyAttribute
- Implements
- Inherited Members
- Extension Methods
Constructors
PrimaryKeyAttribute()
Creates attribute instance.
public PrimaryKeyAttribute()
PrimaryKeyAttribute(int)
Creates attribute instance.
public PrimaryKeyAttribute(int order)
Parameters
order
intColumn order in composite primary key.
PrimaryKeyAttribute(string?, int)
Creates attribute instance.
public PrimaryKeyAttribute(string? configuration, int order)
Parameters
configuration
stringMapping schema configuration name. See LinqToDB.Configuration.
order
intColumn order in composite primary key.
Properties
Order
Gets or sets order of current column in composite primary key.
Order is used for query generation to define in which order primary key columns must be mentioned in query
from columns with smallest order value to greatest.
Default value: -1
.
public int Order { get; set; }
Property Value
Methods
GetObjectID()
Returns mapping attribute id, based on all attribute options.
public override string GetObjectID()