Freigeben über


IndexBuilder Class

Definition

Provides a simple API for configuring an IMutableIndex.

public class IndexBuilder : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.IMutableModel>, Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Internal.InternalIndexBuilder>
public class IndexBuilder : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Internal.InternalIndexBuilder>
public class IndexBuilder : Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder>
type IndexBuilder = class
    interface IInfrastructure<IMutableModel>
    interface IInfrastructure<InternalIndexBuilder>
type IndexBuilder = class
    interface IInfrastructure<InternalIndexBuilder>
type IndexBuilder = class
    interface IInfrastructure<IConventionIndexBuilder>
Public Class IndexBuilder
Implements IInfrastructure(Of IMutableModel), IInfrastructure(Of InternalIndexBuilder)
Public Class IndexBuilder
Implements IInfrastructure(Of InternalIndexBuilder)
Public Class IndexBuilder
Implements IInfrastructure(Of IConventionIndexBuilder)
Inheritance
IndexBuilder
Derived
Implements
IInfrastructure<IMutableModel> IInfrastructure<Microsoft.EntityFrameworkCore.Metadata.Internal.InternalIndexBuilder> IInfrastructure<IConventionIndexBuilder>

Remarks

Instances of this class are returned from methods when using the ModelBuilder API and it is not designed to be directly constructed in your application code.

See Modeling entity types and relationships for more information and examples.

Constructors

IndexBuilder(IMutableIndex)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

IndexBuilder(InternalIndexBuilder)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

Properties

Metadata

The index being configured.

Methods

HasAnnotation(String, Object)

Adds or updates an annotation on the index. If an annotation with the key specified in annotation already exists its value will be updated.

IsDescending(Boolean[])

Configures the sort order(s) for the columns of this index (ascending or descending).

IsUnique(Boolean)

Configures whether this index is unique (i.e. the value(s) for each instance must be unique).

Explicit Interface Implementations

IInfrastructure<IConventionIndexBuilder>.Instance

The internal builder being used to configure the index.

IInfrastructure<IMutableModel>.Instance

The model that the index belongs to.

IInfrastructure<InternalIndexBuilder>.Instance

The internal builder being used to configure the index.

Extension Methods

ForVectors(IndexBuilder, Nullable<VectorIndexType>)

Configures the index as a vector index with the given vector index type, such as "flat", "diskANN", or "quantizedFlat". See Vector Search in Azure Cosmos DB for NoSQL for more information.

GetInfrastructure<T>(IInfrastructure<T>)

Gets the value from a property that is being hidden using IInfrastructure<T>.

This method is typically used by database providers (and other extensions). It is generally not used in application code.

HasDatabaseName(IndexBuilder, String)

Configures the name of the index in the database when targeting a relational database.

HasFilter(IndexBuilder, String)

Configures the filter expression for the index.

HasName(IndexBuilder, String)
Obsolete.

Configures the name of the index in the database when targeting a relational database.

ForSqliteHasName(IndexBuilder, String)

Configures the name of the index in the database when targeting SQLite.

ForSqlServerHasName(IndexBuilder, String)

Configures the name of the index in the database when targeting SQL Server.

ForSqlServerInclude(IndexBuilder, String[])
Obsolete.

Configures index include properties when targeting SQL Server.

ForSqlServerIsClustered(IndexBuilder, Boolean)
Obsolete.

Configures whether the index is clustered when targeting SQL Server.

ForSqlServerIsCreatedOnline(IndexBuilder, Boolean)
Obsolete.

Configures whether the index is created with online option when targeting SQL Server.

HasFillFactor(IndexBuilder, Int32)

Configures whether the index is created with fill factor option when targeting SQL Server.

IncludeProperties(IndexBuilder, String[])

Configures index include properties when targeting SQL Server.

IsClustered(IndexBuilder, Boolean)

Configures whether the index is clustered when targeting SQL Server.

IsCreatedOnline(IndexBuilder, Boolean)

Configures whether the index is created with online option when targeting SQL Server.

SortInTempDb(IndexBuilder, Boolean)

Configures whether the index is created with sort in tempdb option when targeting SQL Server.

UseDataCompression(IndexBuilder, DataCompressionType)

Configures whether the index is created with data compression option when targeting SQL Server.

Applies to