MigrationBuilder.DropForeignKey(String, String, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Builds a DropForeignKeyOperation to drop an existing foreign key constraint.
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.DropForeignKeyOperation> DropForeignKey (string name, string table, string schema = default);
public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.DropForeignKeyOperation> DropForeignKey (string name, string table, string? schema = default);
abstract member DropForeignKey : string * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.DropForeignKeyOperation>
override this.DropForeignKey : string * string * string -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.DropForeignKeyOperation>
Public Overridable Function DropForeignKey (name As String, table As String, Optional schema As String = Nothing) As OperationBuilder(Of DropForeignKeyOperation)
Parameters
- name
- String
The name of the foreign key constraint to drop.
- table
- String
The table that contains the foreign key.
- schema
- String
The schema that contains the table, or null
to use the default schema.
Returns
A builder to allow annotations to be added to the operation.
Remarks
See Database migrations for more information and examples.
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework