共用方式為


SqlServerModelBuilderExtensions.ForSqlServerHasValueGenerationStrategy 方法

定義

警告

Use HasValueGenerationStrategy

設定目標SQL Server時,標示為 OnAdd 之索引鍵屬性的預設值產生策略。

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

參數

modelBuilder
IConventionModelBuilder

模型產生器。

valueGenerationStrategy
Nullable<SqlServerValueGenerationStrategy>

價值產生策略。

fromDataAnnotation
Boolean

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

傳回

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

屬性

適用於