# Class NpgsqlIndexExtensions

Namespace
  Microsoft.EntityFrameworkCore

Assembly
  Npgsql.EntityFrameworkCore.PostgreSQL.dll

Extension methods for IIndex for Npgsql-specific metadata.

    public static class NpgsqlIndexExtensions

Inheritance
  object
  NpgsqlIndexExtensions

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## 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

http://www.postgresql.org/docs/current/static/sql-createindex.html

### GetAreNullsDistinctConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for whether nulls are considered distinct.

    public static ConfigurationSource? GetAreNullsDistinctConfigurationSource(this IConventionIndex index)

#### Parameters

`index` IConventionIndex

  The index.

#### Returns

ConfigurationSource?

  The ConfigurationSource.

### 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

IReadOnlyList<string>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-collations.html

### GetCollationConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the index collations.

    public static ConfigurationSource? GetCollationConfigurationSource(this IConventionIndex index)

#### Parameters

`index` IConventionIndex

  The 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` IReadOnlyIndex

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

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

  The 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

string

#### Remarks

http://www.postgresql.org/docs/current/static/sql-createindex.html

### GetMethodConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the index method.

    public static ConfigurationSource? GetMethodConfigurationSource(this IConventionIndex index)

#### Parameters

`index` IConventionIndex

  The 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

IReadOnlyList<NullSortOrder>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-ordering.html

### GetNullSortOrderConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the index null sort orders.

    public static ConfigurationSource? GetNullSortOrderConfigurationSource(this IConventionIndex index)

#### Parameters

`index` IConventionIndex

  The 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

IReadOnlyList<string>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-opclass.html

### GetOperatorsConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the index operators.

    public static ConfigurationSource? GetOperatorsConfigurationSource(this IConventionIndex index)

#### Parameters

`index` IConventionIndex

  The 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

`index` IReadOnlyIndex

#### Returns

IReadOnlyList<SortOrder>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-ordering.html

### GetSortOrderConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the index sort orders.

    [Obsolete("Use IsDescending instead")]
    public static ConfigurationSource? GetSortOrderConfigurationSource(this IConventionIndex index)

#### Parameters

`index` IConventionIndex

  The 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

`index` IIndex
`parameterName` string

#### Returns

string

### 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` IConventionIndex
`parameterName` string

#### Returns

ConfigurationSource?

### GetStorageParameters(IReadOnlyIndex)

Gets all storage parameters for the index.

    public static Dictionary<string, object?> GetStorageParameters(this IReadOnlyIndex index)

#### Parameters

`index` IReadOnlyIndex

#### Returns

Dictionary<string, object>

### 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` IReadOnlyIndex

  The index.

#### Returns

string

#### Remarks

https://www.postgresql.org/docs/current/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX

### GetTsVectorConfigConfigurationSource(IConventionIndex)

Returns the ConfigurationSource for the tsvector config.

    public static ConfigurationSource? GetTsVectorConfigConfigurationSource(this IConventionIndex index)

#### Parameters

`index` IConventionIndex

  The 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` IReadOnlyIndex

  The 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` IConventionIndex
`nullsDistinct` bool?
`fromDataAnnotation` bool

#### Returns

bool?

#### Remarks

http://www.postgresql.org/docs/current/static/sql-createindex.html

### 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` IMutableIndex
`nullsDistinct` bool?

#### Remarks

http://www.postgresql.org/docs/current/static/sql-createindex.html

### 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` IConventionIndex
`collations` IReadOnlyList<string>
`fromDataAnnotation` bool

#### Returns

IReadOnlyList<string>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-collations.html

### 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` IMutableIndex
`collations` IReadOnlyList<string>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-collations.html

### 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` IConventionIndex

  The index.

`properties` IReadOnlyList<string>

  The value to set.

`fromDataAnnotation` bool

  Indicates whether the configuration was specified using a data annotation.

#### Returns

IReadOnlyList<string>

### SetIncludeProperties(IMutableIndex, IReadOnlyList<string>?)

Sets included property names.

    public static void SetIncludeProperties(this IMutableIndex index, IReadOnlyList<string>? properties)

#### Parameters

`index` IMutableIndex

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

  The index.

`createdConcurrently` bool?

  The value to set.

`fromDataAnnotation` bool

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

  The 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` IConventionIndex
`method` string
`fromDataAnnotation` bool

#### Returns

string

#### Remarks

http://www.postgresql.org/docs/current/static/sql-createindex.html

### 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` IMutableIndex
`method` string

#### Remarks

http://www.postgresql.org/docs/current/static/sql-createindex.html

### 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` IConventionIndex
`nullSortOrder` IReadOnlyList<NullSortOrder>
`fromDataAnnotation` bool

#### Returns

IReadOnlyList<NullSortOrder>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-ordering.html

### 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` IMutableIndex
`nullSortOrder` IReadOnlyList<NullSortOrder>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-ordering.html

### 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` IConventionIndex
`operators` IReadOnlyList<string>
`fromDataAnnotation` bool

#### Returns

IReadOnlyList<string>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-opclass.html

### 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` IMutableIndex
`operators` IReadOnlyList<string>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-opclass.html

### 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

`index` IConventionIndex
`sortOrder` IReadOnlyList<SortOrder>
`fromDataAnnotation` bool

#### Returns

IReadOnlyList<SortOrder>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-ordering.html

### 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

`index` IMutableIndex
`sortOrder` IReadOnlyList<SortOrder>

#### Remarks

https://www.postgresql.org/docs/current/static/indexes-ordering.html

### 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` IConventionIndex
`parameterName` string
`parameterValue` object
`fromDataAnnotation` bool

#### Returns

object

### SetStorageParameter(IMutableIndex, string, object?)

Sets a storage parameter on the index.

    public static void SetStorageParameter(this IMutableIndex index, string parameterName, object? parameterValue)

#### Parameters

`index` IMutableIndex
`parameterName` string
`parameterValue` 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` IConventionIndex

  The index.

`config` string

  The 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` bool

  Indicates whether the configuration was specified using a data annotation.

#### Returns

string

#### Remarks

https://www.postgresql.org/docs/current/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX

### 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` IMutableIndex

  The index.

`config` string

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

#### Remarks

https://www.postgresql.org/docs/current/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX