Class PrimaryKeyColumnAttribute
Attribute that represents a Primary Key
Inheritance
System.Object
System.Attribute
Namespace: Umbraco.Core.Persistence.DatabaseAnnotations
Assembly: Umbraco.Core.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public class PrimaryKeyColumnAttribute : Attribute, _Attribute
Remarks
By default, Clustered and AutoIncrement is set to true.
Constructors
View SourcePrimaryKeyColumnAttribute()
Declaration
public PrimaryKeyColumnAttribute()
Properties
View SourceAutoIncrement
Gets or sets a boolean indicating whether the primary key is auto incremented.
Declaration
public bool AutoIncrement { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Defaults to true
Clustered
Gets or sets a boolean indicating whether the primary key is clustered.
Declaration
public bool Clustered { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Defaults to true
IdentitySeed
Gets or sets the Identity Seed, which is used for Sql Ce databases.
Declaration
public int IdentitySeed { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
We'll only look for changes to seeding and apply them if the configured database is an Sql Ce database.
Name
Gets or sets the name of the PrimaryKey.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Overrides the default naming of a PrimaryKey constraint: PK_tableName
OnColumns
Gets or sets the names of the columns for this PrimaryKey.
Declaration
public string OnColumns { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Should only be used if the PrimaryKey spans over multiple columns. Usage: [nodeId], [otherColumn]