Share via


TableBuilder<TColumns>.Index Method

Definition

Overloads

Index(Expression<Func<TColumns,Object>>, Boolean, Object)

Specifies an index to be created on the table.

Index(Expression<Func<TColumns,Object>>, String, Boolean, Boolean, Object)

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.

Index(Expression<Func<TColumns,Object>>, Boolean, Object)

Specifies an index to be created on the table.

public System.Data.Entity.Migrations.Builders.TableBuilder<TColumns> Index (System.Linq.Expressions.Expression<Func<TColumns,object>> indexExpression, bool unique = false, object anonymousArguments = null);
member this.Index : System.Linq.Expressions.Expression<Func<'Columns, obj>> * bool * obj -> System.Data.Entity.Migrations.Builders.TableBuilder<'Columns>
Public Function Index (indexExpression As Expression(Of Func(Of TColumns, Object)), Optional unique As Boolean = false, Optional anonymousArguments As Object = null) As TableBuilder(Of TColumns)

Parameters

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. C#: t => new { t.PropertyOne, t.PropertyTwo } VB.Net: Function(t) New With { t.PropertyOne, t.PropertyTwo }

unique
Boolean

A value indicating whether or not this is a unique index.

anonymousArguments
Object

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

Returns

Itself, so that multiple calls can be chained.

Applies to

Index(Expression<Func<TColumns,Object>>, String, Boolean, Boolean, Object)

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.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
public System.Data.Entity.Migrations.Builders.TableBuilder<TColumns> Index (System.Linq.Expressions.Expression<Func<TColumns,object>> indexExpression, string name = null, bool unique = false, bool clustered = false, object anonymousArguments = null);
member this.Index : System.Linq.Expressions.Expression<Func<'Columns, obj>> * string * bool * bool * obj -> System.Data.Entity.Migrations.Builders.TableBuilder<'Columns>
Public Function Index (indexExpression As Expression(Of Func(Of TColumns, Object)), Optional name As String = null, Optional unique As Boolean = false, Optional clustered As Boolean = false, Optional anonymousArguments As Object = null) As TableBuilder(Of TColumns)

Parameters

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. C#: t => new { t.PropertyOne, t.PropertyTwo } VB.Net: Function(t) New With { t.PropertyOne, t.PropertyTwo }

name
String

The name of the index.

unique
Boolean

A value indicating whether or not this is a unique index.

clustered
Boolean

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" }'.

Returns

Itself, so that multiple calls can be chained.

Attributes

Applies to