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
index
IReadOnlyIndex
Returns
- bool?
Remarks
GetAreNullsDistinctConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for whether nulls are considered distinct.
public static ConfigurationSource? GetAreNullsDistinctConfigurationSource(this IConventionIndex index)
Parameters
index
IConventionIndexThe 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
index
IReadOnlyIndex
Returns
Remarks
GetCollationConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the index collations.
public static ConfigurationSource? GetCollationConfigurationSource(this IConventionIndex index)
Parameters
index
IConventionIndexThe 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
index
IReadOnlyIndexThe index.
Returns
- IReadOnlyList<string>
The included property names, or
null
if they have not been specified.
GetIncludePropertiesConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the included property names.
public static ConfigurationSource? GetIncludePropertiesConfigurationSource(this IConventionIndex index)
Parameters
index
IConventionIndexThe 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
index
IConventionIndexThe 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
index
IReadOnlyIndex
Returns
Remarks
GetMethodConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the index method.
public static ConfigurationSource? GetMethodConfigurationSource(this IConventionIndex index)
Parameters
index
IConventionIndexThe 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
index
IReadOnlyIndex
Returns
Remarks
GetNullSortOrderConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the index null sort orders.
public static ConfigurationSource? GetNullSortOrderConfigurationSource(this IConventionIndex index)
Parameters
index
IConventionIndexThe 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
index
IReadOnlyIndex
Returns
Remarks
GetOperatorsConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the index operators.
public static ConfigurationSource? GetOperatorsConfigurationSource(this IConventionIndex index)
Parameters
index
IConventionIndexThe index.
Returns
- ConfigurationSource?
The ConfigurationSource for the index operators.
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
index
IConventionIndexparameterName
string
Returns
GetStorageParameters(IReadOnlyIndex)
Gets all storage parameters for the index.
public static Dictionary<string, object?> GetStorageParameters(this IReadOnlyIndex index)
Parameters
index
IReadOnlyIndex
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
index
IReadOnlyIndexThe index.
Returns
Remarks
GetTsVectorConfigConfigurationSource(IConventionIndex)
Returns the ConfigurationSource for the tsvector config.
public static ConfigurationSource? GetTsVectorConfigConfigurationSource(this IConventionIndex index)
Parameters
index
IConventionIndexThe 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
index
IReadOnlyIndexThe index.
Returns
- bool?
true
if 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
index
IConventionIndexnullsDistinct
bool?fromDataAnnotation
bool
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
index
IMutableIndexnullsDistinct
bool?
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
index
IConventionIndexcollations
IReadOnlyList<string>fromDataAnnotation
bool
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
index
IMutableIndexcollations
IReadOnlyList<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
index
IConventionIndexThe index.
properties
IReadOnlyList<string>The value to set.
fromDataAnnotation
boolIndicates 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
index
IMutableIndexThe index.
properties
IReadOnlyList<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
index
IConventionIndexThe index.
createdConcurrently
bool?The value to set.
fromDataAnnotation
boolIndicates 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
index
IMutableIndexThe index.
createdConcurrently
bool?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
index
IConventionIndexmethod
stringfromDataAnnotation
bool
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
index
IMutableIndexmethod
string
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
index
IConventionIndexnullSortOrder
IReadOnlyList<NullSortOrder>fromDataAnnotation
bool
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
index
IMutableIndexnullSortOrder
IReadOnlyList<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
index
IConventionIndexoperators
IReadOnlyList<string>fromDataAnnotation
bool
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
index
IMutableIndexoperators
IReadOnlyList<string>
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
index
IConventionIndexparameterName
stringparameterValue
objectfromDataAnnotation
bool
Returns
SetStorageParameter(IMutableIndex, string, object?)
Sets a storage parameter on the index.
public static void SetStorageParameter(this IMutableIndex index, string parameterName, object? parameterValue)
Parameters
index
IMutableIndexparameterName
stringparameterValue
object
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
index
IConventionIndexThe index.
config
stringThe text search configuration for this generated tsvector property, or
null
if this is not a generated tsvector property.See https://www.postgresql.org/docs/current/textsearch-controls.html for more information.
fromDataAnnotation
boolIndicates 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
index
IMutableIndexThe index.
config
stringThe text search configuration for this generated tsvector property, or
null
if this is not a generated tsvector property.See https://www.postgresql.org/docs/current/textsearch-controls.html for more information.