Table of Contents

Class RelationalIndexExtensions

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

Extension methods for Microsoft.EntityFrameworkCore.Metadata.IIndex for relational database metadata.

public static class RelationalIndexExtensions
Inheritance
RelationalIndexExtensions
Inherited Members

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 IConventionIndex

The index.

storeObject StoreObjectIdentifier

The 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.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 IIndex FindSharedObjectRootIndex(this IIndex index, in StoreObjectIdentifier storeObject)

Parameters

index IIndex

The index.

storeObject StoreObjectIdentifier

The 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 IMutableIndex

The index.

storeObject StoreObjectIdentifier

The identifier of the containing store object.

Returns

IMutableIndex

The index found, or null if none was found.

GetDatabaseName(IIndex)

Returns the name of the index in the database.

public static string GetDatabaseName(this IIndex index)

Parameters

index IIndex

The index.

Returns

string

The name of the index in the database.

GetDatabaseName(IIndex, in StoreObjectIdentifier)

Returns the name of the index in the database.

public static string GetDatabaseName(this IIndex index, in StoreObjectIdentifier storeObject)

Parameters

index IIndex

The index.

storeObject StoreObjectIdentifier

The 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 IConventionIndex

The index.

Returns

ConfigurationSource?

The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the name of the index in the database.

GetDefaultDatabaseName(IIndex)

Returns the default name that would be used for this index.

public static string GetDefaultDatabaseName(this IIndex index)

Parameters

index IIndex

The index.

Returns

string

The default name that would be used for this index.

GetDefaultDatabaseName(IIndex, in StoreObjectIdentifier)

Returns the default name that would be used for this index.

public static string GetDefaultDatabaseName(this IIndex index, in StoreObjectIdentifier storeObject)

Parameters

index IIndex

The index.

storeObject StoreObjectIdentifier

The identifier of the store object.

Returns

string

The default name that would be used for this index.

GetDefaultName(IIndex)

Returns the default name that would be used for this index.

[Obsolete("Use GetDefaultDatabaseName() instead")]
public static string GetDefaultName(this IIndex index)

Parameters

index IIndex

The index.

Returns

string

The default name that would be used for this index.

GetFilter(IIndex)

Returns the index filter expression.

public static string GetFilter(this IIndex index)

Parameters

index IIndex

The index.

Returns

string

The index filter expression.

GetFilter(IIndex, in StoreObjectIdentifier)

Returns the index filter expression.

public static string GetFilter(this IIndex index, in StoreObjectIdentifier storeObject)

Parameters

index IIndex

The index.

storeObject StoreObjectIdentifier

The 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 IConventionIndex

The 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 IIndex

The index.

Returns

IEnumerable<ITableIndex>

The table indexes to which the index is mapped.

GetName(IIndex)

Returns the name of the index in the database.

[Obsolete("Use GetDatabaseName() instead")]
public static string GetName(this IIndex index)

Parameters

index IIndex

The index.

Returns

string

The name of the index in the database.

GetNameConfigurationSource(IConventionIndex)

Gets the Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the name of the index in the database.

[Obsolete("Use GetDatabaseNameConfigurationSource() instead.")]
public static ConfigurationSource? GetNameConfigurationSource(this IConventionIndex index)

Parameters

index IConventionIndex

The index.

Returns

ConfigurationSource?

The Microsoft.EntityFrameworkCore.Metadata.ConfigurationSource for the name of the index in the database.

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 IConventionIndex

The index.

name string

The value to set.

fromDataAnnotation bool

Indicates 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 IMutableIndex

The index.

name string

The 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 IConventionIndex

The index.

value string

The value to set.

fromDataAnnotation bool

Indicates 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 IMutableIndex

The index.

value string

The value to set.

SetName(IConventionIndex, string, bool)

Sets the name of the index in the database.

[Obsolete("Use SetDatabaseName() instead.")]
public static void SetName(this IConventionIndex index, string name, bool fromDataAnnotation = false)

Parameters

index IConventionIndex

The index.

name string

The value to set.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

SetName(IMutableIndex, string)

Sets the name of the index in the database.

[Obsolete("Use SetDatabaseName() instead.")]
public static void SetName(this IMutableIndex index, string name)

Parameters

index IMutableIndex

The index.

name string

The value to set.