Class ForeignKeyAttribute
Attribute that represents a Foreign Key reference
Namespace: Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations
Assembly: Umbraco.Infrastructure.dll
Syntax
public class ForeignKeyAttribute : ReferencesAttributeConstructors
View SourceForeignKeyAttribute(Type)
Declaration
public ForeignKeyAttribute(Type type)Parameters
| Type | Name | Description | 
|---|---|---|
| Type | type | 
Properties
View SourceColumn
Gets or sets the name of the Column that this foreign key should reference.
Declaration
public string Column { get; set; }Property Value
| Type | Description | 
|---|---|
| System.String | 
Remarks
PrimaryKey column is used by default
Name
Gets or sets the name of the foreign key reference
Declaration
public string Name { get; set; }Property Value
| Type | Description | 
|---|---|
| System.String | 
Remarks
Overrides the default naming of a foreign key reference: FK_thisTableName_refTableName
OnDelete
Gets or sets the cascade rule for deletions.
Declaration
public Rule OnDelete { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Data.Rule | 
OnUpdate
Gets or sets the cascade rule for updates.
Declaration
public Rule OnUpdate { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Data.Rule |