AssociationAttribute.DeleteRule 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為關聯設定或設定刪除行為。
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」。
以下範例的規則是不採取行動。