src/Shared/EntityFramework/Migrations/DbMigration.cs
/// <summary>
/// Adds an operation to create an index on multiple columns.
///
/// 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="table">
/// The name of the table to create the index on. Schema name is optional, if no schema is specified
/// then dbo is assumed.
/// </param>
/// <param name="columns"> The name of the columns to create the index on. </param>
/// <param name="unique">
/// A value indicating if this is a unique index. If no value is supplied a non-unique index will be
/// created.
/// </param>
/// <param name="name">
/// The name to use for the index in the database. If no value is supplied a unique name will be
/// generated.
/// </param>
/// <param name="clustered"> A value indicating whether or not this is a clustered index. </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 an index on multiple columns.

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 an index on multiple columns . 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 CreateIndex(
            string table,
            string[] columns,
            bool unique = false,
            string name = null,
            bool clustered = false,
            object anonymousArguments = null)
        {
            Check.NotEmpty(table, "table");
            Check.NotNull(columns, "columns");
            if (!columns.Any())
            {
                throw new ArgumentException(Strings.CollectionEmpty("columns", "CreateIndex"));
            }
            var createIndexOperation
                = new CreateIndexOperation(anonymousArguments)
                  {
                      Table = table,
                      IsUnique = unique,
                      Name = name,
                      IsClustered = clustered
                  };
            columns.Each(c => createIndexOperation.Columns.Add(c));
            AddOperation(createIndexOperation);
        }
[ SuppressMessage ( " " , " " ) ] protected internal void CreateIndex ( string table , string [ ] columns , bool unique = false , string name = null , bool clustered = false , object anonymousArguments = null ) { Check . NotEmpty ( table , " " ) ; Check . NotNull ( columns , " " ) ; if ( ! columns . Any ( ) ) { throw new ArgumentException ( Strings . CollectionEmpty ( " " , " " ) ) ; } var createIndexOperation = new CreateIndexOperation ( anonymousArguments ) { Table = table , IsUnique = unique , Name = name , IsClustered = clustered } ; columns . Each ( c => createIndexOperation . Columns . Add ( c ) ) ; AddOperation ( createIndexOperation ) ; }
Adds an operation to create an index on multiple columns.
Adds an operation to create an index on multiple columns .
table
string
The name of the table to create the index on. Schema name is optional, if no schema is specified
then dbo is assumed.
The name of the table to create the index on . Schema name is optional if no schema is specified then dbo is assumed .
columns
string[]
The name of the columns to create the index on.
The name of the columns to create the index on .
unique
bool
A value indicating if this is a unique index. If no value is supplied a non-unique index will be
created.
A value indicating if this is a unique index . If no value is supplied a non - unique index will be created .
name
string
The name to use for the index in the database. If no value is supplied a unique name will be
generated.
The name to use for the index in the database . If no value is supplied a unique name will be generated .
clustered
bool
A value indicating whether or not this is a clustered index.
A value indicating whether or not this is a clustered index .
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 " } ' .