src/Shared/EntityFramework/Migrations/DbMigration.cs
/// <summary>
/// Adds an operation to create a new foreign key constraint.
///
/// 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 column. Schema name is optional, if no schema is
/// specified then dbo is assumed.
/// </param>
/// <param name="dependentColumn"> The foreign key column. </param>
/// <param name="principalTable">
/// The table that contains the column this foreign key references. Schema name is optional,
/// if no schema is specified then dbo is assumed.
/// </param>
/// <param name="principalColumn">
/// The column this foreign key references. If no value is supplied the primary key of the
/// principal table will be referenced.
/// </param>
/// <param name="cascadeDelete">
/// A value indicating if cascade delete should be configured for the foreign key
/// relationship. If no value is supplied, cascade delete will be off.
/// </param>
/// <param name="name">
/// The name of the foreign key constraint in the database. If no value is supplied a unique name will
/// be generated.
/// </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 create a new foreign key constraint.

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 create a new foreign key constraint . 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 AddForeignKey(
            string dependentTable,
            string dependentColumn,
            string principalTable,
            string principalColumn = null,
            bool cascadeDelete = false,
            string name = null,
            object anonymousArguments = null)
        {
            Check.NotEmpty(dependentTable, "dependentTable");
            Check.NotEmpty(dependentColumn, "dependentColumn");
            Check.NotEmpty(principalTable, "principalTable");
            AddForeignKey(
                dependentTable,
                new[] { dependentColumn },
                principalTable,
                principalColumn != null ? new[] { principalColumn } : null,
                cascadeDelete,
                name,
                anonymousArguments);
        }
[ SuppressMessage ( " " , " " ) ] protected internal void AddForeignKey ( string dependentTable , string dependentColumn , string principalTable , string principalColumn = null , bool cascadeDelete = false , string name = null , object anonymousArguments = null ) { Check . NotEmpty ( dependentTable , " " ) ; Check . NotEmpty ( dependentColumn , " " ) ; Check . NotEmpty ( principalTable , " " ) ; AddForeignKey ( dependentTable , new [ ] { dependentColumn } , principalTable , principalColumn != null ? new [ ] { principalColumn } : null , cascadeDelete , name , anonymousArguments ) ; }
Adds an operation to create a new foreign key constraint.
Adds an operation to create a new foreign key constraint .
dependentTable
string
The table that contains the foreign key column. Schema name is optional, if no schema is
specified then dbo is assumed.
The table that contains the foreign key column . Schema name is optional if no schema is specified then dbo is assumed .
dependentColumn
string
The foreign key column.
The foreign key column .
principalTable
string
The table that contains the column this foreign key references. Schema name is optional,
if no schema is specified then dbo is assumed.
The table that contains the column this foreign key references . Schema name is optional if no schema is specified then dbo is assumed .
principalColumn
string
The column this foreign key references. If no value is supplied the primary key of the
principal table will be referenced.
The column this foreign key references . If no value is supplied the primary key of the principal table will be referenced .
cascadeDelete
bool
A value indicating if cascade delete should be configured for the foreign key
relationship. If no value is supplied, cascade delete will be off.
A value indicating if cascade delete should be configured for the foreign key relationship . If no value is supplied cascade delete will be off .
name
string
The name of the foreign key constraint in the database. If no value is supplied a unique name will
be generated.
The name of the foreign key constraint in the database . If no value is supplied a unique name will be generated .
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 " } ' .