AssociationAttribute.DeleteRule 属性

定义

获取或设置关联的删除行为。

public:
 property System::String ^ DeleteRule { System::String ^ get(); void set(System::String ^ value); };
public string DeleteRule { get; set; }
member this.DeleteRule : string with get, set
Public Property DeleteRule As String

属性值

一个表示规则的字符串。

示例

[Association(Name="FK_Products_Categories", Storage="_Products", OtherKey="CategoryID", DeleteRule="NO ACTION")]
public EntitySet<Product> Products
{
    get
    {
        return this._Products;
    }
    set
    {
        this._Products.Assign(value);
    }
}
<Association(Name:="FK_Products_Categories", Storage:="_Products", OtherKey:="CategoryID", DeleteRule:="NO ACTION")>  _
Public Property Products() As EntitySet(Of Product)
    Get
        Return Me._Products
    End Get
    Set
        Me._Products.Assign(value)
    End Set
End Property

注解

如果设置为 null,则不添加删除行为。 例如,“CASCADE”会将“ON DELETE CASCADE”添加到外键关系中。

在以下示例中,规则不执行任何操作。

适用于