Search Results for

    Show / Hide Table of Contents

    Class ForeignKeyAttribute

    Attribute that represents a Foreign Key reference

    Inheritance
    System.Object
    System.Attribute
    ReferencesAttribute
    Namespace: Umbraco.Cms.Infrastructure.Persistence.DatabaseAnnotations
    Assembly: cs.temp.dll.dll
    Syntax
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
    public class ForeignKeyAttribute : ReferencesAttribute, _Attribute

    Constructors

    ForeignKeyAttribute(Type)

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

    Properties

    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

    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
    Rule

    OnUpdate

    Gets or sets the cascade rule for updates.

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