src/Shared/EntityFramework/Migrations/DbMigration.cs
/// <summary>
/// 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.
/// </summary>
/// <param name="dependentTable">
/// The table that contains the foreign key columns. Schema name is optional, if no schema is
/// specified then dbo is assumed.
/// </param>
/// <param name="dependentColumns"> The foreign key columns. </param>
/// <param name="principalTable">
/// The table that contains the columns this foreign key references. Schema name is optional,
/// if no schema is specified then dbo is assumed.
/// </param>
/// <param name="anonymousArguments">
/// Additional arguments that may be processed by providers. Use anonymous type syntax to
/// specify arguments e.g. 'new { SampleArgument = "MyValue" }'.
/// </param>
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.
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 .
[SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
        protected internal void DropForeignKey(
            string dependentTable,
            string[] dependentColumns,
            string principalTable,
            object anonymousArguments = null)
        {
            Check.NotEmpty(dependentTable, "dependentTable");
            Check.NotNull(dependentColumns, "dependentColumns");
            Check.NotEmpty(principalTable, "principalTable");
            if (!dependentColumns.Any())
            {
                throw new ArgumentException(Strings.CollectionEmpty("dependentColumns", "DropForeignKey"));
            }
            var dropForeignKeyOperation
                = new DropForeignKeyOperation(anonymousArguments)
                  {
                      DependentTable = dependentTable,
                      PrincipalTable = principalTable
                  };
            dependentColumns.Each(c => dropForeignKeyOperation.DependentColumns.Add(c));
            AddOperation(dropForeignKeyOperation);
        }
[ SuppressMessage ( " " , " " ) ] protected internal void DropForeignKey ( string dependentTable , string [ ] dependentColumns , string principalTable , object anonymousArguments = null ) { Check . NotEmpty ( dependentTable , " " ) ; Check . NotNull ( dependentColumns , " " ) ; Check . NotEmpty ( principalTable , " " ) ; if ( ! dependentColumns . Any ( ) ) { throw new ArgumentException ( Strings . CollectionEmpty ( " " , " " ) ) ; } var dropForeignKeyOperation = new DropForeignKeyOperation ( anonymousArguments ) { DependentTable = dependentTable , PrincipalTable = principalTable } ; dependentColumns . Each ( c => dropForeignKeyOperation . DependentColumns . Add ( c ) ) ; AddOperation ( dropForeignKeyOperation ) ; }
Adds an operation to drop a foreign key constraint based on the columns it targets.
Adds an operation to drop a foreign key constraint based on the columns it targets .
dependentTable
string
The table that contains the foreign key columns. Schema name is optional, if no schema is
specified then dbo is assumed.
The table that contains the foreign key columns . Schema name is optional if no schema is specified then dbo is assumed .
dependentColumns
string[]
The foreign key columns.
The foreign key columns .
principalTable
string
The table that contains the columns this foreign key references. Schema name is optional,
if no schema is specified then dbo is assumed.
The table that contains the columns this foreign key references . 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" }'.
Additional arguments that may be processed by providers . Use anonymous type syntax to specify arguments e . g . ' new { SampleArgument = " MyValue " } ' .