Table of Contents

Class RelationalIndexBuilderExtensions

Namespace
Microsoft.EntityFrameworkCore
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

Relational database specific extension methods for Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder.

public static class RelationalIndexBuilderExtensions
Inheritance
RelationalIndexBuilderExtensions
Inherited Members

Methods

CanSetDatabaseName(IConventionIndexBuilder, string, bool)

Returns a value indicating whether the given name can be set for the index.

public static bool CanSetDatabaseName(this IConventionIndexBuilder indexBuilder, string name, bool fromDataAnnotation = false)

Parameters

indexBuilder IConventionIndexBuilder

The builder for the index being configured.

name string

The name of the index.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given name can be set for the index.

CanSetFilter(IConventionIndexBuilder, string, bool)

Returns a value indicating whether the given expression can be set as the filter for the index.

public static bool CanSetFilter(this IConventionIndexBuilder indexBuilder, string sql, bool fromDataAnnotation = false)

Parameters

indexBuilder IConventionIndexBuilder

The builder for the index being configured.

sql string

The filter expression for the index.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given name can be set for the index.

CanSetName(IConventionIndexBuilder, string, bool)

Returns a value indicating whether the given name can be set for the index.

[Obsolete("Use CanSetDatabaseName() instead.")]
public static bool CanSetName(this IConventionIndexBuilder indexBuilder, string name, bool fromDataAnnotation = false)

Parameters

indexBuilder IConventionIndexBuilder

The builder for the index being configured.

name string

The name of the index.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the given name can be set for the index.

HasDatabaseName(IConventionIndexBuilder, string, bool)

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

public static IConventionIndexBuilder HasDatabaseName(this IConventionIndexBuilder indexBuilder, string name, bool fromDataAnnotation = false)

Parameters

indexBuilder IConventionIndexBuilder

The builder for the index being configured.

name string

The name of the index.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionIndexBuilder

The same builder instance if the configuration was applied, null otherwise.

HasDatabaseName(IndexBuilder, string)

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

public static IndexBuilder HasDatabaseName(this IndexBuilder indexBuilder, string name)

Parameters

indexBuilder IndexBuilder

The builder for the index being configured.

name string

The name of the index.

Returns

IndexBuilder

A builder to further configure the index.

HasDatabaseName<TEntity>(IndexBuilder<TEntity>, string)

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

public static IndexBuilder<TEntity> HasDatabaseName<TEntity>(this IndexBuilder<TEntity> indexBuilder, string name)

Parameters

indexBuilder IndexBuilder<TEntity>

The builder for the index being configured.

name string

The name of the index.

Returns

IndexBuilder<TEntity>

A builder to further configure the index.

Type Parameters

TEntity

The entity type being configured.

HasFilter(IConventionIndexBuilder, string, bool)

Configures the filter expression for the index.

public static IConventionIndexBuilder HasFilter(this IConventionIndexBuilder indexBuilder, string sql, bool fromDataAnnotation = false)

Parameters

indexBuilder IConventionIndexBuilder

The builder for the index being configured.

sql string

The filter expression for the index.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionIndexBuilder

The same builder instance if the configuration was applied, null otherwise.

HasFilter(IndexBuilder, string)

Configures the filter expression for the index.

public static IndexBuilder HasFilter(this IndexBuilder indexBuilder, string sql)

Parameters

indexBuilder IndexBuilder

The builder for the index being configured.

sql string

The filter expression for the index.

Returns

IndexBuilder

A builder to further configure the index.

HasFilter<TEntity>(IndexBuilder<TEntity>, string)

Configures the filter expression for the index.

public static IndexBuilder<TEntity> HasFilter<TEntity>(this IndexBuilder<TEntity> indexBuilder, string sql)

Parameters

indexBuilder IndexBuilder<TEntity>

The builder for the index being configured.

sql string

The filter expression for the index.

Returns

IndexBuilder<TEntity>

A builder to further configure the index.

Type Parameters

TEntity

The entity type being configured.

HasName(IConventionIndexBuilder, string, bool)

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

[Obsolete("Use HasDatabaseName() instead.")]
public static IConventionIndexBuilder HasName(this IConventionIndexBuilder indexBuilder, string name, bool fromDataAnnotation = false)

Parameters

indexBuilder IConventionIndexBuilder

The builder for the index being configured.

name string

The name of the index.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionIndexBuilder

The same builder instance if the configuration was applied, null otherwise.

HasName(IndexBuilder, string)

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

[Obsolete("Use HasDatabaseName() instead.")]
public static IndexBuilder HasName(this IndexBuilder indexBuilder, string name)

Parameters

indexBuilder IndexBuilder

The builder for the index being configured.

name string

The name of the index.

Returns

IndexBuilder

A builder to further configure the index.

HasName<TEntity>(IndexBuilder<TEntity>, string)

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

[Obsolete("Use HasDatabaseName() instead.")]
public static IndexBuilder<TEntity> HasName<TEntity>(this IndexBuilder<TEntity> indexBuilder, string name)

Parameters

indexBuilder IndexBuilder<TEntity>

The builder for the index being configured.

name string

The name of the index.

Returns

IndexBuilder<TEntity>

A builder to further configure the index.

Type Parameters

TEntity

The entity type being configured.