Class RelationalIndexExtensions
- Namespace
- Microsoft.EntityFrameworkCore
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Index extension methods for relational database metadata.
public static class RelationalIndexExtensions
- Inheritance
-
RelationalIndexExtensions
- Inherited Members
Remarks
See Indexes for more information and examples.
Methods
FindSharedObjectRootIndex(IConventionIndex, in StoreObjectIdentifier)
Finds the first Microsoft.EntityFrameworkCore.Metadata.IConventionIndex that is mapped to the same index in a shared table-like object.
This method is typically used by database providers (and other extensions). It is generally not used in application code.
public static IConventionIndex? FindSharedObjectRootIndex(this IConventionIndex index, in StoreObjectIdentifier storeObject)
Parameters
index
IConventionIndexThe index.
storeObject
StoreObjectIdentifierThe identifier of the containing store object.
Returns
- IConventionIndex
The index found, or null if none was found.
FindSharedObjectRootIndex(IIndex, in StoreObjectIdentifier)
Finds the first Microsoft.EntityFrameworkCore.Metadata.IConventionIndex that is mapped to the same index in a shared table-like object.
This method is typically used by database providers (and other extensions). It is generally not used in application code.
public static IIndex? FindSharedObjectRootIndex(this IIndex index, in StoreObjectIdentifier storeObject)
Parameters
index
IIndexThe index.
storeObject
StoreObjectIdentifierThe identifier of the containing store object.
Returns
- IIndex
The index found, or null if none was found.
FindSharedObjectRootIndex(IMutableIndex, in StoreObjectIdentifier)
Finds the first Microsoft.EntityFrameworkCore.Metadata.IMutableIndex that is mapped to the same index in a shared table-like object.
This method is typically used by database providers (and other extensions). It is generally not used in application code.
public static IMutableIndex? FindSharedObjectRootIndex(this IMutableIndex index, in StoreObjectIdentifier storeObject)
Parameters
index
IMutableIndexThe index.
storeObject
StoreObjectIdentifierThe identifier of the containing store object.
Returns
- IMutableIndex
The index found, or null if none was found.
FindSharedObjectRootIndex(IReadOnlyIndex, in StoreObjectIdentifier)
Finds the first Microsoft.EntityFrameworkCore.Metadata.IIndex that is mapped to the same index in a shared table-like object.
This method is typically used by database providers (and other extensions). It is generally not used in application code.
public static IReadOnlyIndex? FindSharedObjectRootIndex(this IReadOnlyIndex index, in StoreObjectIdentifier storeObject)
Parameters
index
IReadOnlyIndexThe index.
storeObject
StoreObjectIdentifierThe identifier of the containing store object.
Returns
- IReadOnlyIndex
The index found, or null if none was found.
GetDatabaseName(IReadOnlyIndex)
Returns the name of the index in the database.
public static string? GetDatabaseName(this IReadOnlyIndex index)
Parameters
index
IReadOnlyIndexThe index.
Returns
- string
The name of the index in the database.
GetDatabaseName(IReadOnlyIndex, in StoreObjectIdentifier)
Returns the name of the index in the database.
public static string? GetDatabaseName(this IReadOnlyIndex index, in StoreObjectIdentifier storeObject)
Parameters
index
IReadOnlyIndexThe index.
storeObject
StoreObjectIdentifierThe identifier of the store object.
Returns
- string
The name of the index in the database.
GetDatabaseNameConfigurationSource(IConventionIndex)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the name of the index in the database.
public static ConfigurationSource? GetDatabaseNameConfigurationSource(this IConventionIndex index)
Parameters
index
IConventionIndexThe index.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the name of the index in the database.
GetDefaultDatabaseName(IReadOnlyIndex)
Returns the default name that would be used for this index.
public static string? GetDefaultDatabaseName(this IReadOnlyIndex index)
Parameters
index
IReadOnlyIndexThe index.
Returns
- string
The default name that would be used for this index.
GetDefaultDatabaseName(IReadOnlyIndex, in StoreObjectIdentifier)
Returns the default name that would be used for this index.
public static string? GetDefaultDatabaseName(this IReadOnlyIndex index, in StoreObjectIdentifier storeObject)
Parameters
index
IReadOnlyIndexThe index.
storeObject
StoreObjectIdentifierThe identifier of the store object.
Returns
- string
The default name that would be used for this index.
GetFilter(IReadOnlyIndex)
Returns the index filter expression.
public static string? GetFilter(this IReadOnlyIndex index)
Parameters
index
IReadOnlyIndexThe index.
Returns
- string
The index filter expression.
GetFilter(IReadOnlyIndex, in StoreObjectIdentifier)
Returns the index filter expression.
public static string? GetFilter(this IReadOnlyIndex index, in StoreObjectIdentifier storeObject)
Parameters
index
IReadOnlyIndexThe index.
storeObject
StoreObjectIdentifierThe identifier of the containing store object.
Returns
- string
The index filter expression.
GetFilterConfigurationSource(IConventionIndex)
Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the index filter expression.
public static ConfigurationSource? GetFilterConfigurationSource(this IConventionIndex index)
Parameters
index
IConventionIndexThe index.
Returns
- ConfigurationSource?
The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the index filter expression.
GetMappedTableIndexes(IIndex)
Gets the table indexes to which the index is mapped.
public static IEnumerable<ITableIndex> GetMappedTableIndexes(this IIndex index)
Parameters
index
IIndexThe index.
Returns
- IEnumerable<ITableIndex>
The table indexes to which the index is mapped.
SetDatabaseName(IConventionIndex, string?, bool)
Sets the name of the index in the database.
public static string? SetDatabaseName(this IConventionIndex index, string? name, bool fromDataAnnotation = false)
Parameters
index
IConventionIndexThe index.
name
stringThe value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetDatabaseName(IMutableIndex, string?)
Sets the name of the index in the database.
public static void SetDatabaseName(this IMutableIndex index, string? name)
Parameters
index
IMutableIndexThe index.
name
stringThe value to set.
SetFilter(IConventionIndex, string?, bool)
Sets the index filter expression.
public static string? SetFilter(this IConventionIndex index, string? value, bool fromDataAnnotation = false)
Parameters
index
IConventionIndexThe index.
value
stringThe value to set.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- string
The configured value.
SetFilter(IMutableIndex, string?)
Sets the index filter expression.
public static void SetFilter(this IMutableIndex index, string? value)
Parameters
index
IMutableIndexThe index.
value
stringThe value to set.