Share via


AssociationAttribute.DeleteRule Propiedad

Definición

Obtiene o establece el comportamiento de eliminación para una asociación.

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

Valor de propiedad

Cadena que representa la regla.

Ejemplos

[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

Comentarios

Si se establece en NULL, no se agrega ningún comportamiento de eliminación. Por ejemplo, "CASCADE" agregaría "ON DELETE CASCADE" a la relación de clave externa.

En el ejemplo siguiente, la regla es no realizar ninguna acción.

Se aplica a