共用方式為


RelationalIndexBuilderExtensions.HasName 方法

定義

多載

HasName(IndexBuilder, String)
已淘汰.

以關係資料庫為目標時,設定資料庫中的索引名稱。

HasName(IConventionIndexBuilder, String, Boolean)
已淘汰.

以關係資料庫為目標時,設定資料庫中的索引名稱。

HasName<TEntity>(IndexBuilder<TEntity>, String)
已淘汰.

以關係資料庫為目標時,設定資料庫中的索引名稱。

HasName(IndexBuilder, String)

來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs

警告

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);
[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

參數

indexBuilder
IndexBuilder

要設定之索引的產生器。

name
String

索引的名稱。

傳回

進一步設定索引的建立器。

屬性

備註

如需詳細資訊和範例,請參閱 索引

適用於

HasName(IConventionIndexBuilder, String, Boolean)

來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs

警告

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);
[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

參數

indexBuilder
IConventionIndexBuilder

要設定之索引的產生器。

name
String

索引的名稱。

fromDataAnnotation
Boolean

指出是否使用資料批註來指定組態。

傳回

如果套用組態,則為相同的產生器實例, null 否則為 。

屬性

備註

如需詳細資訊,請參閱 索引

適用於

HasName<TEntity>(IndexBuilder<TEntity>, String)

來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs
來源:
RelationalIndexBuilderExtensions.cs

警告

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);
[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)

類型參數

TEntity

正在設定的實體型別。

參數

indexBuilder
IndexBuilder<TEntity>

要設定之索引的產生器。

name
String

索引的名稱。

傳回

IndexBuilder<TEntity>

進一步設定索引的建立器。

屬性

備註

如需詳細資訊,請參閱 索引

適用於