IndexBuilder Class

Definition

Provides a simple API for configuring an IMutableIndex.

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.

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

See Modeling entity types and relationships for more information.

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.

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

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.

IInfrastructure<T> is used to hide properties that are not intended to be used in application code but can be used in extension methods written by database providers etc.

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.

Applies to