CascadeDeleteConvention Class

Definition

A convention that sets the delete behavior to Cascade for required foreign keys and ClientSetNull for optional ones.

public class CascadeDeleteConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRequirednessChangedConvention
type CascadeDeleteConvention = class
    interface IForeignKeyAddedConvention
    interface IConvention
    interface IForeignKeyRequirednessChangedConvention
Public Class CascadeDeleteConvention
Implements IForeignKeyAddedConvention, IForeignKeyRequirednessChangedConvention
Inheritance
CascadeDeleteConvention
Derived
Implements

Remarks

See Model building conventions for more information and examples.

Constructors

CascadeDeleteConvention(ProviderConventionSetBuilderDependencies)

Creates a new instance of CascadeDeleteConvention.

Properties

Dependencies

Dependencies for this service.

Methods

GetTargetDeleteBehavior(IConventionForeignKey)

Returns the delete behavior to set for the given foreign key.

ProcessForeignKeyAdded(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

Called after a foreign key is added to the entity type.

ProcessForeignKeyAdded(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

Called after a foreign key is added to the entity type.

ProcessForeignKeyRequirednessChanged(IConventionForeignKeyBuilder, IConventionContext<Nullable<Boolean>>)

Called after the requiredness for a foreign key is changed.

ProcessForeignKeyRequirednessChanged(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

Called after the requiredness for a foreign key is changed.

Applies to