共用方式為


RelationalIndexBuilderExtensions.CanSetName 方法

定義

警告

Use CanSetDatabaseName() instead.

傳回值,指出是否可以為索引設定指定的名稱。

public static bool CanSetName (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder indexBuilder, string name, bool fromDataAnnotation = false);
[System.Obsolete("Use CanSetDatabaseName() instead.")]
public static bool CanSetName (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder indexBuilder, string name, bool fromDataAnnotation = false);
[System.Obsolete("Use CanSetDatabaseName() instead.")]
public static bool CanSetName (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder indexBuilder, string? name, bool fromDataAnnotation = false);
static member CanSetName : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder * string * bool -> bool
[<System.Obsolete("Use CanSetDatabaseName() instead.")>]
static member CanSetName : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder * string * bool -> bool
<Extension()>
Public Function CanSetName (indexBuilder As IConventionIndexBuilder, name As String, Optional fromDataAnnotation As Boolean = false) As Boolean

參數

indexBuilder
IConventionIndexBuilder

要設定之索引的產生器。

name
String

索引的名稱。

fromDataAnnotation
Boolean

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

傳回

true 如果可以設定索引的指定名稱,則為 。

屬性

備註

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

適用於