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
indexBuilderIConventionIndexBuilderThe builder for the index being configured.
namestringThe name of the index.
fromDataAnnotationboolIndicates whether the configuration was specified using a data annotation.
Returns
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
indexBuilderIConventionIndexBuilderThe builder for the index being configured.
sqlstringThe filter expression for the index.
fromDataAnnotationboolIndicates whether the configuration was specified using a data annotation.
Returns
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
indexBuilderIConventionIndexBuilderThe builder for the index being configured.
namestringThe name of the index.
fromDataAnnotationboolIndicates whether the configuration was specified using a data annotation.
Returns
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
indexBuilderIConventionIndexBuilderThe builder for the index being configured.
namestringThe name of the index.
fromDataAnnotationboolIndicates 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
indexBuilderIndexBuilderThe builder for the index being configured.
namestringThe 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
indexBuilderIndexBuilder<TEntity>The builder for the index being configured.
namestringThe name of the index.
Returns
- IndexBuilder<TEntity>
A builder to further configure the index.
Type Parameters
TEntityThe 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
indexBuilderIConventionIndexBuilderThe builder for the index being configured.
sqlstringThe filter expression for the index.
fromDataAnnotationboolIndicates 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
indexBuilderIndexBuilderThe builder for the index being configured.
sqlstringThe 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
indexBuilderIndexBuilder<TEntity>The builder for the index being configured.
sqlstringThe filter expression for the index.
Returns
- IndexBuilder<TEntity>
A builder to further configure the index.
Type Parameters
TEntityThe 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
indexBuilderIConventionIndexBuilderThe builder for the index being configured.
namestringThe name of the index.
fromDataAnnotationboolIndicates 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
indexBuilderIndexBuilderThe builder for the index being configured.
namestringThe 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
indexBuilderIndexBuilder<TEntity>The builder for the index being configured.
namestringThe name of the index.
Returns
- IndexBuilder<TEntity>
A builder to further configure the index.
Type Parameters
TEntityThe entity type being configured.