Share via


DbMigration.DropPrimaryKey Method

Definition

Overloads

DropPrimaryKey(String, Object)

Adds an operation to drop an existing primary key that was created with the default 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.

DropPrimaryKey(String, String, Object)

Adds an operation to drop an existing primary key that does not have the default 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.

DropPrimaryKey(String, Object)

Adds an operation to drop an existing primary key that was created with the default 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.

protected internal void DropPrimaryKey (string table, object anonymousArguments = null);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void DropPrimaryKey (string table, object anonymousArguments = null);
member this.DropPrimaryKey : string * obj -> unit
Protected Friend Sub DropPrimaryKey (table As String, Optional anonymousArguments As Object = null)

Parameters

table
String

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

anonymousArguments
Object

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

Attributes

Applies to

DropPrimaryKey(String, String, Object)

Adds an operation to drop an existing primary key that does not have the default 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.

protected internal void DropPrimaryKey (string table, string name, object anonymousArguments = null);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
protected internal void DropPrimaryKey (string table, string name, object anonymousArguments = null);
member this.DropPrimaryKey : string * string * obj -> unit
Protected Friend Sub DropPrimaryKey (table As String, name As String, Optional anonymousArguments As Object = null)

Parameters

table
String

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

name
String

The name of the primary key to be dropped.

anonymousArguments
Object

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

Attributes

Applies to