Class PrimaryKeyAttribute
Marks property or field as a member of primary key for current mapping type.
Namespace: LinqToDB.Mapping
Assembly: linq2db.dll
Syntax
public class PrimaryKeyAttribute : MappingAttribute
Constructors
| Improve this Doc View SourcePrimaryKeyAttribute()
Creates attribute instance.
Declaration
public PrimaryKeyAttribute()
PrimaryKeyAttribute(Int32)
Creates attribute instance.
Declaration
public PrimaryKeyAttribute(int order)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | order | Column order in composite primary key. |
PrimaryKeyAttribute(Nullable<String>, Int32)
Creates attribute instance.
Declaration
public PrimaryKeyAttribute(string? configuration, int order)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.String> | configuration | Mapping schema configuration name. See Configuration. |
System.Int32 | order | Column order in composite primary key. |
Properties
| Improve this Doc View SourceConfiguration
Gets or sets mapping schema configuration name, for which this attribute should be taken into account.
ProviderName for standard names.
Attributes with null
or empty string Configuration value applied to all configurations (if no attribute found for current configuration).
Declaration
public string? Configuration { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.String> |
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
.
Declaration
public int Order { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceGetObjectID()
Declaration
public override string GetObjectID()
Returns
Type | Description |
---|---|
System.String |