Class ForeignKeyAttribute
Attribute that represents a Foreign Key reference
Namespace: Umbraco.Core.Persistence.DatabaseAnnotations
Assembly: Umbraco.Core.dll
Syntax
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public class ForeignKeyAttribute : ReferencesAttribute, _Attribute
Constructors
View SourceForeignKeyAttribute(Type)
Declaration
public ForeignKeyAttribute(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.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 |