RelationalIndexBuilderExtensions.HasName 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
HasName(IndexBuilder, String) |
Obsolete.
Configures the name of the index in the database when targeting a relational database. |
HasName(IConventionIndexBuilder, String, Boolean) |
Obsolete.
Configures the name of the index in the database when targeting a relational database. |
HasName<TEntity>(IndexBuilder<TEntity>, String) |
Obsolete.
Configures the name of the index in the database when targeting a relational database. |
HasName(IndexBuilder, String)
Caution
Use HasDatabaseName() instead.
Configures the name of the index in the database when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder HasName (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder indexBuilder, string name);
[System.Obsolete("Use HasDatabaseName() instead.")]
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder HasName (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder indexBuilder, string name);
[System.Obsolete("Use HasDatabaseName() instead.")]
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder HasName (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder indexBuilder, string? name);
static member HasName : Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder
[<System.Obsolete("Use HasDatabaseName() instead.")>]
static member HasName : Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder
<Extension()>
Public Function HasName (indexBuilder As IndexBuilder, name As String) As IndexBuilder
Parameters
- indexBuilder
- IndexBuilder
The builder for the index being configured.
- name
- String
The name of the index.
Returns
A builder to further configure the index.
- Attributes
Remarks
See Indexes for more information and examples.
Applies to
HasName(IConventionIndexBuilder, String, Boolean)
Caution
Use HasDatabaseName() instead.
Configures the name of the index in the database when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasName (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder indexBuilder, string name, bool fromDataAnnotation = false);
[System.Obsolete("Use HasDatabaseName() instead.")]
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasName (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder indexBuilder, string name, bool fromDataAnnotation = false);
[System.Obsolete("Use HasDatabaseName() instead.")]
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? HasName (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder indexBuilder, string? name, bool fromDataAnnotation = false);
static member HasName : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
[<System.Obsolete("Use HasDatabaseName() instead.")>]
static member HasName : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
<Extension()>
Public Function HasName (indexBuilder As IConventionIndexBuilder, name As String, Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder
Parameters
- indexBuilder
- IConventionIndexBuilder
The builder for the index being configured.
- name
- String
The name of the index.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The same builder instance if the configuration was applied,
null
otherwise.
- Attributes
Remarks
See Indexes for more information.
Applies to
HasName<TEntity>(IndexBuilder<TEntity>, String)
Caution
Use HasDatabaseName() instead.
Configures the name of the index in the database when targeting a relational database.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> HasName<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> indexBuilder, string name);
[System.Obsolete("Use HasDatabaseName() instead.")]
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> HasName<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> indexBuilder, string name);
[System.Obsolete("Use HasDatabaseName() instead.")]
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> HasName<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> indexBuilder, string? name);
static member HasName : Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity>
[<System.Obsolete("Use HasDatabaseName() instead.")>]
static member HasName : Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity>
<Extension()>
Public Function HasName(Of TEntity) (indexBuilder As IndexBuilder(Of TEntity), name As String) As IndexBuilder(Of TEntity)
Type Parameters
- TEntity
The entity type being configured.
Parameters
- indexBuilder
- IndexBuilder<TEntity>
The builder for the index being configured.
- name
- String
The name of the index.
Returns
A builder to further configure the index.
- Attributes
Remarks
See Indexes for more information.
Applies to
Entity Framework