src/Shared/EntityFramework/Migrations/Builders/TableBuilder.cs
/// <summary>
/// Specifies an index to be created on the table.
///
/// 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="indexExpression"> A lambda expression representing the property to be indexed. C#: t => t.PropertyOne VB.Net: Function(t) t.PropertyOne If multiple properties are to be indexed then specify an anonymous type including the properties. C#: t => new { t.PropertyOne, t.PropertyTwo } VB.Net: Function(t) New With { t.PropertyOne, t.PropertyTwo } </param>
/// <param name="name"> The name of the index. </param>
/// <param name="unique"> A value indicating whether or not this is a unique index. </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>
/// <returns> Itself, so that multiple calls can be chained. </returns>
Specifies an index to be created on the table.

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.
Specifies an index to be created on the table . 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", "CA1011:ConsiderPassingBaseTypesAsParameters")]
        [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
        [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public TableBuilder<TColumns> Index(
            Expression<Func<TColumns, object>> indexExpression,
            string name = null,
            bool unique = false,
            bool clustered = false,
            object anonymousArguments = null)
        {
            Check.NotNull(indexExpression, "indexExpression");
            var createIndexOperation
                = new CreateIndexOperation(anonymousArguments)
                {
                    Name = name,
                    Table = _createTableOperation.Name,
                    IsUnique = unique,
                    IsClustered = clustered
                };
            indexExpression
                .GetSimplePropertyAccessList()
                .Select(p => _createTableOperation.Columns.Single(c => c.ApiPropertyInfo == p.Single()))
                .Each(c => createIndexOperation.Columns.Add(c.Name));
            _migration.AddOperation(createIndexOperation);
            return this;
        }
[ SuppressMessage ( " " , " " ) ] [ SuppressMessage ( " " , " " ) ] [ SuppressMessage ( " " , " " ) ] public TableBuilder < TColumns > Index ( Expression < Func < TColumns , object > > indexExpression , string name = null , bool unique = false , bool clustered = false , object anonymousArguments = null ) { Check . NotNull ( indexExpression , " " ) ; var createIndexOperation = new CreateIndexOperation ( anonymousArguments ) { Name = name , Table = _createTableOperation . Name , IsUnique = unique , IsClustered = clustered } ; indexExpression . GetSimplePropertyAccessList ( ) . Select ( p => _createTableOperation . Columns . Single ( c => c . ApiPropertyInfo == p . Single ( ) ) ) . Each ( c => createIndexOperation . Columns . Add ( c . Name ) ) ; _migration . AddOperation ( createIndexOperation ) ; return this ; }
Specifies an index to be created on the table.
Specifies an index to be created on the table .
Itself, so that multiple calls can be chained.
Itself so that multiple calls can be chained .
indexExpression
Expression<Func<TColumns, object>>
A lambda expression representing the property to be indexed. C#: t => t.PropertyOne VB.Net: Function(t) t.PropertyOne If multiple properties are to be indexed then specify an anonymous type including the properties.
A lambda expression representing the property to be indexed . C# : t = > t . PropertyOne VB . Net : Function ( t ) t . PropertyOne If multiple properties are to be indexed then specify an anonymous type including the properties .
name
string
The name of the index.
The name of the index .
unique
bool
A value indicating whether or not this is a unique index.
A value indicating whether or not this is a unique index .
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 " } ' .