DbMigration.DropForeignKey Method

 

Adds an operation to drop a foreign key constraint based on its name.

Namespace:   System.Data.Entity.Migrations
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_protmethodDropForeignKey(String, String, Object)

Adds an operation to drop a foreign key constraint based on its name. Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

System_CAPS_protmethodDropForeignKey(String, String, String, Object)

Adds an operation to drop a foreign key constraint based on the column it targets. Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

System_CAPS_protmethodDropForeignKey(String, String, String, String, Object)

Obsolete.Adds an operation to drop a foreign key constraint based on the column it targets. Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

System_CAPS_protmethodDropForeignKey(String, String[], String, Object)

Adds an operation to drop a foreign key constraint based on the columns it targets. Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.


DbMigration.DropForeignKey Method (String, String, Object)

Adds an operation to drop a foreign key constraint based on its name. Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void DropForeignKey(
	string dependentTable,
	string name,
	object anonymousArguments = null
)

Parameters

dependentTable
Type: System.String

The table that contains the foreign key column. Schema name is optional, if no schema is specified then dbo is assumed.

name
Type: System.String

The name of the foreign key constraint in the database.

anonymousArguments
Type: System.Object

The additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'.


DbMigration.DropForeignKey Method (String, String, String, Object)

Adds an operation to drop a foreign key constraint based on the column it targets. Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void DropForeignKey(
	string dependentTable,
	string dependentColumn,
	string principalTable,
	object anonymousArguments = null
)

Parameters

dependentTable
Type: System.String

The table that contains the foreign key column. Schema name is optional, if no schema is specified then dbo is assumed.

dependentColumn
Type: System.String

The foreign key column.

principalTable
Type: System.String

The table that contains the column this foreign key references. Schema name is optional, if no schema is specified then dbo is assumed.

anonymousArguments
Type: System.Object

The additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'.


DbMigration.DropForeignKey Method (String, String, String, String, Object)

Note: This API is now obsolete.

Adds an operation to drop a foreign key constraint based on the column it targets. Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", 
	MessageId = "principalColumn")]
[ObsoleteAttribute("The principalColumn parameter is no longer required and can be removed.")]
[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void DropForeignKey(
	string dependentTable,
	string dependentColumn,
	string principalTable,
	string principalColumn,
	object anonymousArguments = null
)

Parameters

dependentTable
Type: System.String

The table that contains the foreign key column. Schema name is optional, if no schema is specified then dbo is assumed.

dependentColumn
Type: System.String

The foreign key column.

principalTable
Type: System.String

The table that contains the column this foreign key references. Schema name is optional, if no schema is specified then dbo is assumed.

principalColumn
Type: System.String

The columns this foreign key references.

anonymousArguments
Type: System.Object

The additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'.


DbMigration.DropForeignKey Method (String, String[], String, Object)

Adds an operation to drop a foreign key constraint based on the columns it targets. Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.

[SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void DropForeignKey(
	string dependentTable,
	string[] dependentColumns,
	string principalTable,
	object anonymousArguments = null
)

Parameters

dependentTable
Type: System.String

The table that contains the foreign key columns. Schema name is optional, if no schema is specified then dbo is assumed.

dependentColumns
Type: System.String[]

The foreign key columns.

principalTable
Type: System.String

The table that contains the columns this foreign key references. Schema name is optional, if no schema is specified then dbo is assumed.

anonymousArguments
Type: System.Object

The additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'.