語言

SqlServerPropertyBuilderExtensions.HasValueGenerationStrategy 方法

定義

多載

名稱 Description
HasValueGenerationStrategy(IConventionPropertyBuilder, Nullable<SqlServerValueGenerationStrategy>, Boolean)

在針對 SQL Server 時,配置關鍵屬性的價值產生策略。

HasValueGenerationStrategy(IConventionPropertyBuilder, Nullable<SqlServerValueGenerationStrategy>, StoreObjectIdentifier, Boolean)

在針對特定資料表針對 SQL Server 時,配置關鍵屬性的值產生策略。

HasValueGenerationStrategy(IConventionPropertyBuilder, Nullable<SqlServerValueGenerationStrategy>, Boolean)

來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs

在針對 SQL Server 時,配置關鍵屬性的價值產生策略。

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

參數

propertyBuilder
IConventionPropertyBuilder

正在配置的物業的建商。

valueGenerationStrategy
Nullable<SqlServerValueGenerationStrategy>

價值創造策略。

fromDataAnnotation
Boolean

表示配置是否以資料註解方式指定。

傳回

如果設定是套用,則使用同一個建構者實例, null 否則。

備註

更多資訊與範例請參閱「建模實體類型與關係」,以及「使用 EF Core 存取 SQL Server 與 Azure SQL 資料庫」。

適用於

HasValueGenerationStrategy(IConventionPropertyBuilder, Nullable<SqlServerValueGenerationStrategy>, StoreObjectIdentifier, Boolean)

來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs
來源:
SqlServerPropertyBuilderExtensions.cs

在針對特定資料表針對 SQL Server 時,配置關鍵屬性的值產生策略。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasValueGenerationStrategy(this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, Microsoft.EntityFrameworkCore.Metadata.SqlServerValueGenerationStrategy? valueGenerationStrategy, in Microsoft.EntityFrameworkCore.Metadata.StoreObjectIdentifier storeObject, bool fromDataAnnotation = false);
static member HasValueGenerationStrategy : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * Nullable<Microsoft.EntityFrameworkCore.Metadata.SqlServerValueGenerationStrategy> * StoreObjectIdentifier * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
<Extension()>
Public Function HasValueGenerationStrategy (propertyBuilder As IConventionPropertyBuilder, valueGenerationStrategy As Nullable(Of SqlServerValueGenerationStrategy), ByRef storeObject As StoreObjectIdentifier, Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

參數

propertyBuilder
IConventionPropertyBuilder

正在配置的物業的建商。

valueGenerationStrategy
Nullable<SqlServerValueGenerationStrategy>

價值創造策略。

storeObject
StoreObjectIdentifier

資料表識別碼。

fromDataAnnotation
Boolean

表示配置是否以資料註解方式指定。

傳回

如果設定是套用,則使用同一個建構者實例, null 否則。

備註

更多資訊與範例請參閱「建模實體類型與關係」,以及「使用 EF Core 存取 SQL Server 與 Azure SQL 資料庫」。

適用於