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 如果可为索引设置给定名称,则为 。

属性

注解

有关详细信息 ,请参阅索引

适用于