共用方式為


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 否則為 。

屬性

適用於