共用方式為


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” 新增至外鍵關聯性。

在下列範例中,規則是不採取任何動作。

適用於