IConventionEntityTypeBuilder.HasIndex Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasIndex(IReadOnlyList<IConventionProperty>, Boolean) |
Configures an index on the specified properties. If there is an existing index on the given list of properties, then the existing index will be returned for configuration. |
HasIndex(IReadOnlyList<String>, Boolean) |
Configures an index on the specified property names. If there is an existing index on the given list of property names, then the existing index will be returned for configuration. |
HasIndex(IReadOnlyList<IConventionProperty>, String, Boolean) |
Configures an index on the specified properties, with the specified name. If there is an existing index on the given set of properties and with the given name, then the existing index will be returned for configuration. |
HasIndex(IReadOnlyList<String>, String, Boolean) |
Configures an index on the specified property names. If there is an existing index on the given list of property names, then the existing index will be returned for configuration. |
HasIndex(IReadOnlyList<IConventionProperty>, Boolean)
Configures an index on the specified properties. If there is an existing index on the given list of properties, then the existing index will be returned for configuration.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? HasIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
abstract member HasIndex : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
Public Function HasIndex (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder
Parameters
- properties
- IReadOnlyList<IConventionProperty>
The properties that make up the index.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the index if it exists on the entity type,
null
otherwise.
Applies to
HasIndex(IReadOnlyList<String>, Boolean)
Configures an index on the specified property names. If there is an existing index on the given list of property names, then the existing index will be returned for configuration.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasIndex (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? HasIndex (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
abstract member HasIndex : System.Collections.Generic.IReadOnlyList<string> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
Public Function HasIndex (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder
Parameters
- propertyNames
- IReadOnlyList<String>
The names of the properties that make up the index.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the index if it exists on the entity type,
null
otherwise.
Applies to
HasIndex(IReadOnlyList<IConventionProperty>, String, Boolean)
Configures an index on the specified properties, with the specified name. If there is an existing index on the given set of properties and with the given name, then the existing index will be returned for configuration.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, string name, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? HasIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, string name, bool fromDataAnnotation = false);
abstract member HasIndex : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
Public Function HasIndex (properties As IReadOnlyList(Of IConventionProperty), name As String, Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder
Parameters
- properties
- IReadOnlyList<IConventionProperty>
The properties that make up the index.
- name
- String
The name of the index.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the index if it exists on the entity type,
null
otherwise.
Applies to
HasIndex(IReadOnlyList<String>, String, Boolean)
Configures an index on the specified property names. If there is an existing index on the given list of property names, then the existing index will be returned for configuration.
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasIndex (System.Collections.Generic.IReadOnlyList<string> propertyNames, string name, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? HasIndex (System.Collections.Generic.IReadOnlyList<string> propertyNames, string name, bool fromDataAnnotation = false);
abstract member HasIndex : System.Collections.Generic.IReadOnlyList<string> * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
Public Function HasIndex (propertyNames As IReadOnlyList(Of String), name As String, Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder
Parameters
- propertyNames
- IReadOnlyList<String>
The names of the properties that make up the index.
- name
- String
The name of the index.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
An object that can be used to configure the index if it exists on the entity type,
null
otherwise.
Applies to
Entity Framework