TableBuilder<TColumns>.Index 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Index(Expression<Func<TColumns,Object>>, Boolean, Object) |
指定要在資料表上建立的索引。 |
Index(Expression<Func<TColumns,Object>>, String, Boolean, Boolean, Object) |
指定要在資料表上建立的索引。 Entity Framework 移轉 API 並非設計來接受不受信任的來源所提供的輸入, (例如應用程式的使用者) 。 如果從這類來源接受輸入,則應該先加以驗證,再傳遞至這些 API 以防範 SQL 插入式攻擊等。 |
Index(Expression<Func<TColumns,Object>>, Boolean, Object)
指定要在資料表上建立的索引。
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)
參數
- indexExpression
- Expression<Func<TColumns,Object>>
Lambda 運算式,表示要編制索引的屬性。
C#: t = > t.PropertyOne
VB.Net:函式 (t) t.PropertyOne
如果要編制多個屬性的索引,請指定包含屬性的匿名型別。 C#: t = > new { t.PropertyOne, t.PropertyTwo } VB.Net: Function (t) New With { t.PropertyOne, t.PropertyTwo }
- unique
- Boolean
值,指出這個 是否為唯一索引。
- anonymousArguments
- Object
提供者可能處理的其他引數。 使用匿名型別語法來指定引數,例如 'new { SampleArgument = 「MyValue」 }'。
傳回
本身,讓多個呼叫可以鏈結。
適用於
Index(Expression<Func<TColumns,Object>>, String, Boolean, Boolean, Object)
指定要在資料表上建立的索引。
Entity Framework 移轉 API 並非設計來接受不受信任的來源所提供的輸入, (例如應用程式的使用者) 。 如果從這類來源接受輸入,則應該先加以驗證,再傳遞至這些 API 以防範 SQL 插入式攻擊等。
[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)
參數
- indexExpression
- Expression<Func<TColumns,Object>>
Lambda 運算式,表示要編制索引的屬性。 C#: t = > t.PropertyOne VB.Net:函式 (t) t.PropertyOne 如果要編制索引,請指定包含屬性的匿名型別。 C#: t = > new { t.PropertyOne, t.PropertyTwo } VB.Net: Function (t) New With { t.PropertyOne, t.PropertyTwo }
- name
- String
索引的名稱。
- unique
- Boolean
值,指出這個 是否為唯一索引。
- clustered
- Boolean
值,指出這是否為叢集索引。
- anonymousArguments
- Object
提供者可能處理的其他引數。 使用匿名型別語法來指定引數,例如 'new { SampleArgument = 「MyValue」 }'。
傳回
本身,讓多個呼叫可以鏈結。
- 屬性