SqlServerPropertyBuilderExtensions.ForSqlServerHasValueGenerationStrategy 方法

定义

注意

Use HasValueGenerationStrategy

针对SQL Server时,为键属性配置值生成策略。

[System.Obsolete("Use HasValueGenerationStrategy")]
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder ForSqlServerHasValueGenerationStrategy (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, Microsoft.EntityFrameworkCore.Metadata.SqlServerValueGenerationStrategy? valueGenerationStrategy, bool fromDataAnnotation = false);
[<System.Obsolete("Use HasValueGenerationStrategy")>]
static member ForSqlServerHasValueGenerationStrategy : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * Nullable<Microsoft.EntityFrameworkCore.Metadata.SqlServerValueGenerationStrategy> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
<Extension()>
Public Function ForSqlServerHasValueGenerationStrategy (propertyBuilder As IConventionPropertyBuilder, valueGenerationStrategy As Nullable(Of SqlServerValueGenerationStrategy), Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

参数

propertyBuilder
IConventionPropertyBuilder

要配置的属性的生成器。

valueGenerationStrategy
Nullable<SqlServerValueGenerationStrategy>

值生成策略。

fromDataAnnotation
Boolean

指示是否使用数据注释指定配置。

返回

如果应用了配置,则为同一生成器实例, null 否则为 。

属性

适用于