Interface ICreateForeignKeyCascadeBuilder
Provides a builder interface for configuring cascade behaviors (such as ON DELETE or ON UPDATE) on a foreign key constraint during migration creation.
Namespace: Umbraco.Cms.Infrastructure.Migrations.Expressions.Create.ForeignKey
Assembly: Umbraco.Infrastructure.dll
Syntax
public interface ICreateForeignKeyCascadeBuilder : IFluentBuilder, IExecutableBuilder
Methods
View SourceOnDelete(Rule)
Sets the action to take when a referenced row is deleted by specifying the delete rule for the foreign key constraint.
Declaration
ICreateForeignKeyCascadeBuilder OnDelete(Rule rule)
Parameters
| Type | Name | Description |
|---|---|---|
| Rule | rule | The System.Data.Rule that defines the delete behavior (e.g., Cascade, SetNull, Restrict). |
Returns
| Type | Description |
|---|---|
| ICreateForeignKeyCascadeBuilder | The current ICreateForeignKeyCascadeBuilder instance for method chaining. |
OnDeleteOrUpdate(Rule)
Configures the action to take when the referenced row is deleted or updated in the foreign key relationship.
Declaration
IExecutableBuilder OnDeleteOrUpdate(Rule rule)
Parameters
| Type | Name | Description |
|---|---|---|
| Rule | rule | The referential action (such as Cascade, SetNull, or Restrict) to apply on delete or update. |
Returns
| Type | Description |
|---|---|
| IExecutableBuilder | An IExecutableBuilder to continue building the migration expression. |
OnUpdate(Rule)
Sets the action to take when the referenced primary key is updated for this foreign key constraint.
Declaration
ICreateForeignKeyCascadeBuilder OnUpdate(Rule rule)
Parameters
| Type | Name | Description |
|---|---|---|
| Rule | rule | The update rule to apply (e.g., Cascade, SetNull, Restrict). |
Returns
| Type | Description |
|---|---|
| ICreateForeignKeyCascadeBuilder | The current ICreateForeignKeyCascadeBuilder instance for method chaining. |