共用方式為


SqlServerIndexBuilderExtensions.IncludeProperties 方法

定義

多載

IncludeProperties(IndexBuilder, String[])

設定索引在目標SQL Server時包含屬性。

IncludeProperties(IConventionIndexBuilder, IReadOnlyList<String>, Boolean)

設定索引在目標SQL Server時包含屬性。

IncludeProperties<TEntity>(IndexBuilder<TEntity>, Expression<Func<TEntity,Object>>)

設定索引在目標SQL Server時包含屬性。

IncludeProperties<TEntity>(IndexBuilder<TEntity>, String[])

設定索引在目標SQL Server時包含屬性。

IncludeProperties(IndexBuilder, String[])

設定索引在目標SQL Server時包含屬性。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder IncludeProperties (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder indexBuilder, params string[] propertyNames);
static member IncludeProperties : Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder * string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder
<Extension()>
Public Function IncludeProperties (indexBuilder As IndexBuilder, ParamArray propertyNames As String()) As IndexBuilder

參數

indexBuilder
IndexBuilder

要設定之索引的產生器。

propertyNames
String[]

要用於 'include' 子句的屬性名稱陣列。

傳回

進一步設定索引的建立器。

備註

如需詳細資訊和範例,請參閱使用 EF Core建立實體類型和關聯性的模型化,以及存取SQL Server和Azure SQL資料庫

適用於

IncludeProperties(IConventionIndexBuilder, IReadOnlyList<String>, Boolean)

設定索引在目標SQL Server時包含屬性。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder IncludeProperties (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder indexBuilder, System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? IncludeProperties (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder indexBuilder, System.Collections.Generic.IReadOnlyList<string>? propertyNames, bool fromDataAnnotation = false);
static member IncludeProperties : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder * System.Collections.Generic.IReadOnlyList<string> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
<Extension()>
Public Function IncludeProperties (indexBuilder As IConventionIndexBuilder, propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder

參數

indexBuilder
IConventionIndexBuilder

要設定之索引的產生器。

propertyNames
IReadOnlyList<String>

要用於 'include' 子句的屬性名稱陣列。

fromDataAnnotation
Boolean

指出是否使用資料批註來指定組態。

傳回

如果套用組態,則為相同的產生器實例, null 否則為 。

備註

如需詳細資訊和範例,請參閱使用 EF Core建立實體類型和關聯性的模型化,以及存取SQL Server和Azure SQL資料庫

適用於

IncludeProperties<TEntity>(IndexBuilder<TEntity>, Expression<Func<TEntity,Object>>)

設定索引在目標SQL Server時包含屬性。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> IncludeProperties<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> indexBuilder, System.Linq.Expressions.Expression<Func<TEntity,object>> includeExpression);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> IncludeProperties<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> indexBuilder, System.Linq.Expressions.Expression<Func<TEntity,object?>> includeExpression);
static member IncludeProperties : Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity> * System.Linq.Expressions.Expression<Func<'Entity, obj>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity>
<Extension()>
Public Function IncludeProperties(Of TEntity) (indexBuilder As IndexBuilder(Of TEntity), includeExpression As Expression(Of Func(Of TEntity, Object))) As IndexBuilder(Of TEntity)

類型參數

TEntity

參數

indexBuilder
IndexBuilder<TEntity>

要設定之索引的產生器。

includeExpression
Expression<Func<TEntity,Object>>

Lambda 運算式,表示要包含在 'include' 子句中的屬性) ( (blog => blog.Url) 。

如果要包含多個屬性,請指定匿名型別,包括屬性 (post => new { post.Title, post.BlogId }) 。

傳回

IndexBuilder<TEntity>

進一步設定索引的建立器。

備註

如需詳細資訊和範例,請參閱使用 EF Core建立實體類型和關聯性的模型化,以及存取SQL Server和Azure SQL資料庫

適用於

IncludeProperties<TEntity>(IndexBuilder<TEntity>, String[])

設定索引在目標SQL Server時包含屬性。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> IncludeProperties<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> indexBuilder, params string[] propertyNames);
static member IncludeProperties : Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity> * string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity>
<Extension()>
Public Function IncludeProperties(Of TEntity) (indexBuilder As IndexBuilder(Of TEntity), ParamArray propertyNames As String()) As IndexBuilder(Of TEntity)

類型參數

TEntity

參數

indexBuilder
IndexBuilder<TEntity>

要設定之索引的產生器。

propertyNames
String[]

要用於 'include' 子句的屬性名稱陣列。

傳回

IndexBuilder<TEntity>

進一步設定索引的建立器。

備註

如需詳細資訊和範例,請參閱使用 EF Core建立實體類型和關聯性的模型化,以及存取SQL Server和Azure SQL資料庫

適用於