Search Results for

    Show / Hide Table of Contents
    View Source

    Class ForeignKeyAttribute

    Attribute that represents a Foreign Key reference

    Inheritance
    System.Object
    ReferencesAttribute
    Namespace: Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public class ForeignKeyAttribute : ReferencesAttribute

    Constructors

    View Source

    ForeignKeyAttribute(Type)

    Declaration
    public ForeignKeyAttribute(Type type)
    Parameters
    Type Name Description
    Type type

    Properties

    View Source

    Column

    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

    View Source

    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

    View Source

    OnDelete

    Gets or sets the cascade rule for deletions.

    Declaration
    public Rule OnDelete { get; set; }
    Property Value
    Type Description
    System.Data.Rule
    View Source

    OnUpdate

    Gets or sets the cascade rule for updates.

    Declaration
    public Rule OnUpdate { get; set; }
    Property Value
    Type Description
    System.Data.Rule
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • ForeignKeyAttribute(Type)
    • Properties
      • Column
      • Name
      • OnDelete
      • OnUpdate
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX