Class NpgsqlIndexExtensions
- Namespace
- Microsoft.EntityFrameworkCore
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.dll
Extension methods for IIndex for Npgsql-specific metadata.
public static class NpgsqlIndexExtensions
- Inheritance
-
NpgsqlIndexExtensions
- Inherited Members
Methods
GetAreNullsDistinct(IReadOnlyIndex)
Returns whether for a unique index, null values should be considered distinct (not equal). The default is that they are distinct, so that a unique index could contain multiple null values in a column.
public static bool? GetAreNullsDistinct(this IReadOnlyIndex index)
Parameters
indexIReadOnlyIndex
Returns
- bool?
Remarks
GetAreNullsDistinctConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for whether nulls are considered distinct.
public static ConfigurationSource? GetAreNullsDistinctConfigurationSource(this IConventionIndex index)
Parameters
indexIConventionIndexThe index.
Returns
GetCollation(IReadOnlyIndex)
Returns the column collations to be used, or null if they have not been specified.
public static IReadOnlyList<string>? GetCollation(this IReadOnlyIndex index)
Parameters
indexIReadOnlyIndex
Returns
Remarks
GetCollationConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the index collations.
public static ConfigurationSource? GetCollationConfigurationSource(this IConventionIndex index)
Parameters
indexIConventionIndexThe index.
Returns
- ConfigurationSource?
The ConfigurationSource for the index collations.
GetIncludeProperties(IReadOnlyIndex)
Returns included property names, or null if they have not been specified.
public static IReadOnlyList<string>? GetIncludeProperties(this IReadOnlyIndex index)
Parameters
indexIReadOnlyIndexThe index.
Returns
- IReadOnlyList<string>
The included property names, or
nullif they have not been specified.
GetIncludePropertiesConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the included property names.
public static ConfigurationSource? GetIncludePropertiesConfigurationSource(this IConventionIndex index)
Parameters
indexIConventionIndexThe index.
Returns
- ConfigurationSource?
The ConfigurationSource for the included property names.
GetIsCreatedConcurrentlyConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for whether the index is created concurrently.
public static ConfigurationSource? GetIsCreatedConcurrentlyConfigurationSource(this IConventionIndex index)
Parameters
indexIConventionIndexThe index.
Returns
- ConfigurationSource?
The ConfigurationSource for whether the index is created concurrently.
GetMethod(IReadOnlyIndex)
Returns the index method to be used, or null if it hasn't been specified.
null selects the default (currently btree).
public static string? GetMethod(this IReadOnlyIndex index)
Parameters
indexIReadOnlyIndex
Returns
Remarks
GetMethodConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the index method.
public static ConfigurationSource? GetMethodConfigurationSource(this IConventionIndex index)
Parameters
indexIConventionIndexThe index.
Returns
- ConfigurationSource?
The ConfigurationSource for the index method.
GetNullSortOrder(IReadOnlyIndex)
Returns the column NULL sort orders to be used, or null if they have not been specified.
public static IReadOnlyList<NullSortOrder>? GetNullSortOrder(this IReadOnlyIndex index)
Parameters
indexIReadOnlyIndex
Returns
Remarks
GetNullSortOrderConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the index null sort orders.
public static ConfigurationSource? GetNullSortOrderConfigurationSource(this IConventionIndex index)
Parameters
indexIConventionIndexThe index.
Returns
- ConfigurationSource?
The ConfigurationSource for the index null sort orders.
GetOperators(IReadOnlyIndex)
Returns the column operators to be used, or null if they have not been specified.
public static IReadOnlyList<string>? GetOperators(this IReadOnlyIndex index)
Parameters
indexIReadOnlyIndex
Returns
Remarks
GetOperatorsConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the index operators.
public static ConfigurationSource? GetOperatorsConfigurationSource(this IConventionIndex index)
Parameters
indexIConventionIndexThe index.
Returns
- ConfigurationSource?
The ConfigurationSource for the index operators.
GetSortOrder(IReadOnlyIndex)
Returns the column sort orders to be used, or null if they have not been specified.
[Obsolete("Use IsDescending instead")]
public static IReadOnlyList<SortOrder>? GetSortOrder(this IReadOnlyIndex index)
Parameters
indexIReadOnlyIndex
Returns
Remarks
GetSortOrderConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the index sort orders.
[Obsolete("Use IsDescending instead")]
public static ConfigurationSource? GetSortOrderConfigurationSource(this IConventionIndex index)
Parameters
indexIConventionIndexThe index.
Returns
- ConfigurationSource?
The ConfigurationSource for the index sort orders.
GetStorageParameter(IIndex, string)
Gets a storage parameter for the index.
public static string? GetStorageParameter(this IIndex index, string parameterName)
Parameters
Returns
GetStorageParameterConfigurationSource(IConventionIndex, string)
Gets the configuration source for a storage parameter for the table mapped to the entity type.
public static ConfigurationSource? GetStorageParameterConfigurationSource(this IConventionIndex index, string parameterName)
Parameters
indexIConventionIndexparameterNamestring
Returns
GetStorageParameters(IReadOnlyIndex)
Gets all storage parameters for the index.
public static Dictionary<string, object?> GetStorageParameters(this IReadOnlyIndex index)
Parameters
indexIReadOnlyIndex
Returns
GetTsVectorConfig(IReadOnlyIndex)
Returns the text search configuration for this tsvector expression index, or null if this is not a
tsvector expression index.
public static string? GetTsVectorConfig(this IReadOnlyIndex index)
Parameters
indexIReadOnlyIndexThe index.
Returns
Remarks
GetTsVectorConfigConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the tsvector config.
public static ConfigurationSource? GetTsVectorConfigConfigurationSource(this IConventionIndex index)
Parameters
indexIConventionIndexThe index.
Returns
- ConfigurationSource?
The ConfigurationSource for the tsvector config.
IsCreatedConcurrently(IReadOnlyIndex)
Returns a value indicating whether the index is created concurrently.
public static bool? IsCreatedConcurrently(this IReadOnlyIndex index)
Parameters
indexIReadOnlyIndexThe index.
Returns
- bool?
trueif the index is created concurrently.
SetAreNullsDistinct(IConventionIndex, bool?, bool)
Sets whether for a unique index, null values should be considered distinct (not equal). The default is that they are distinct, so that a unique index could contain multiple null values in a column.
public static bool? SetAreNullsDistinct(this IConventionIndex index, bool? nullsDistinct, bool fromDataAnnotation = false)
Parameters
indexIConventionIndexnullsDistinctbool?fromDataAnnotationbool
Returns
- bool?
Remarks
SetAreNullsDistinct(IMutableIndex, bool?)
Sets whether for a unique index, null values should be considered distinct (not equal). The default is that they are distinct, so that a unique index could contain multiple null values in a column.
public static void SetAreNullsDistinct(this IMutableIndex index, bool? nullsDistinct)
Parameters
indexIMutableIndexnullsDistinctbool?
Remarks
SetCollation(IConventionIndex, IReadOnlyList<string>?, bool)
Sets the column collations to be used, or null if they have not been specified.
public static IReadOnlyList<string>? SetCollation(this IConventionIndex index, IReadOnlyList<string>? collations, bool fromDataAnnotation = false)
Parameters
indexIConventionIndexcollationsIReadOnlyList<string>fromDataAnnotationbool
Returns
Remarks
SetCollation(IMutableIndex, IReadOnlyList<string>?)
Sets the column collations to be used, or null if they have not been specified.
public static void SetCollation(this IMutableIndex index, IReadOnlyList<string>? collations)
Parameters
indexIMutableIndexcollationsIReadOnlyList<string>
Remarks
SetIncludeProperties(IConventionIndex, IReadOnlyList<string>?, bool)
Sets included property names.
public static IReadOnlyList<string>? SetIncludeProperties(this IConventionIndex index, IReadOnlyList<string>? properties, bool fromDataAnnotation = false)
Parameters
indexIConventionIndexThe index.
propertiesIReadOnlyList<string>The value to set.
fromDataAnnotationboolIndicates whether the configuration was specified using a data annotation.
Returns
SetIncludeProperties(IMutableIndex, IReadOnlyList<string>?)
Sets included property names.
public static void SetIncludeProperties(this IMutableIndex index, IReadOnlyList<string>? properties)
Parameters
indexIMutableIndexThe index.
propertiesIReadOnlyList<string>The value to set.
SetIsCreatedConcurrently(IConventionIndex, bool?, bool)
Sets a value indicating whether the index is created concurrently.
public static bool? SetIsCreatedConcurrently(this IConventionIndex index, bool? createdConcurrently, bool fromDataAnnotation = false)
Parameters
indexIConventionIndexThe index.
createdConcurrentlybool?The value to set.
fromDataAnnotationboolIndicates whether the configuration was specified using a data annotation.
Returns
- bool?
SetIsCreatedConcurrently(IMutableIndex, bool?)
Sets a value indicating whether the index is created concurrently.
public static void SetIsCreatedConcurrently(this IMutableIndex index, bool? createdConcurrently)
Parameters
indexIMutableIndexThe index.
createdConcurrentlybool?The value to set.
SetMethod(IConventionIndex, string?, bool)
Sets the index method to be used, or null if it hasn't been specified.
null selects the default (currently btree).
public static string? SetMethod(this IConventionIndex index, string? method, bool fromDataAnnotation = false)
Parameters
indexIConventionIndexmethodstringfromDataAnnotationbool
Returns
Remarks
SetMethod(IMutableIndex, string?)
Sets the index method to be used, or null if it hasn't been specified.
null selects the default (currently btree).
public static void SetMethod(this IMutableIndex index, string? method)
Parameters
indexIMutableIndexmethodstring
Remarks
SetNullSortOrder(IConventionIndex, IReadOnlyList<NullSortOrder>?, bool)
Sets the column NULL sort orders to be used, or null if they have not been specified.
public static IReadOnlyList<NullSortOrder>? SetNullSortOrder(this IConventionIndex index, IReadOnlyList<NullSortOrder>? nullSortOrder, bool fromDataAnnotation = false)
Parameters
indexIConventionIndexnullSortOrderIReadOnlyList<NullSortOrder>fromDataAnnotationbool
Returns
Remarks
SetNullSortOrder(IMutableIndex, IReadOnlyList<NullSortOrder>?)
Sets the column NULL sort orders to be used, or null if they have not been specified.
public static void SetNullSortOrder(this IMutableIndex index, IReadOnlyList<NullSortOrder>? nullSortOrder)
Parameters
indexIMutableIndexnullSortOrderIReadOnlyList<NullSortOrder>
Remarks
SetOperators(IConventionIndex, IReadOnlyList<string>?, bool)
Sets the column operators to be used, or null if they have not been specified.
public static IReadOnlyList<string>? SetOperators(this IConventionIndex index, IReadOnlyList<string>? operators, bool fromDataAnnotation = false)
Parameters
indexIConventionIndexoperatorsIReadOnlyList<string>fromDataAnnotationbool
Returns
Remarks
SetOperators(IMutableIndex, IReadOnlyList<string>?)
Sets the column operators to be used, or null if they have not been specified.
public static void SetOperators(this IMutableIndex index, IReadOnlyList<string>? operators)
Parameters
indexIMutableIndexoperatorsIReadOnlyList<string>
Remarks
SetSortOrder(IConventionIndex, IReadOnlyList<SortOrder>?, bool)
Sets the column sort orders to be used, or null if they have not been specified.
[Obsolete("Use IsDescending instead")]
public static IReadOnlyList<SortOrder>? SetSortOrder(this IConventionIndex index, IReadOnlyList<SortOrder>? sortOrder, bool fromDataAnnotation = false)
Parameters
indexIConventionIndexsortOrderIReadOnlyList<SortOrder>fromDataAnnotationbool
Returns
Remarks
SetSortOrder(IMutableIndex, IReadOnlyList<SortOrder>?)
Sets the column sort orders to be used, or null if they have not been specified.
[Obsolete("Use IsDescending instead")]
public static void SetSortOrder(this IMutableIndex index, IReadOnlyList<SortOrder>? sortOrder)
Parameters
indexIMutableIndexsortOrderIReadOnlyList<SortOrder>
Remarks
SetStorageParameter(IConventionIndex, string, object?, bool)
Sets a storage parameter on the index.
public static object SetStorageParameter(this IConventionIndex index, string parameterName, object? parameterValue, bool fromDataAnnotation = false)
Parameters
indexIConventionIndexparameterNamestringparameterValueobjectfromDataAnnotationbool
Returns
SetStorageParameter(IMutableIndex, string, object?)
Sets a storage parameter on the index.
public static void SetStorageParameter(this IMutableIndex index, string parameterName, object? parameterValue)
Parameters
indexIMutableIndexparameterNamestringparameterValueobject
SetTsVectorConfig(IConventionIndex, string?, bool)
Sets the index to tsvector config name to be used.
public static string? SetTsVectorConfig(this IConventionIndex index, string? config, bool fromDataAnnotation = false)
Parameters
indexIConventionIndexThe index.
configstringThe text search configuration for this generated tsvector property, or
nullif this is not a generated tsvector property.See https://www.postgresql.org/docs/current/textsearch-controls.html for more information.
fromDataAnnotationboolIndicates whether the configuration was specified using a data annotation.
Returns
Remarks
SetTsVectorConfig(IMutableIndex, string?)
Sets the text search configuration for this tsvector expression index, or null if this is not a
tsvector expression index.
public static void SetTsVectorConfig(this IMutableIndex index, string? config)
Parameters
indexIMutableIndexThe index.
configstringThe text search configuration for this generated tsvector property, or
nullif this is not a generated tsvector property.See https://www.postgresql.org/docs/current/textsearch-controls.html for more information.