Udostępnij za pośrednictwem


AssociationAttribute.DeleteRule Właściwość

Definicja

Pobiera lub ustawia zachowanie usuwania dla skojarzenia.

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

Wartość właściwości

Ciąg reprezentujący regułę.

Przykłady

[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

Uwagi

W przypadku ustawienia wartości null żadne zachowanie usuwania nie zostanie dodane. Na przykład wyrażenie "CASCADE" doda wartość "ON DELETE CASCADE" do relacji klucza obcego.

W poniższym przykładzie reguła nie podejmuje żadnych działań.

Dotyczy