SqlServerPropertyBuilderExtensions.CanSetValueGenerationStrategy 方法

定義

多載

CanSetValueGenerationStrategy(IConventionPropertyBuilder, Nullable<SqlServerValueGenerationStrategy>, Boolean)

傳回值,指出指定的值是否可以設定為值產生策略。

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

傳回值,指出指定的值是否可以設定為特定資料表的值產生策略。

CanSetValueGenerationStrategy(IConventionPropertyBuilder, Nullable<SqlServerValueGenerationStrategy>, Boolean)

傳回值,指出指定的值是否可以設定為值產生策略。

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

參數

propertyBuilder
IConventionPropertyBuilder

要設定之屬性的產生器。

valueGenerationStrategy
Nullable<SqlServerValueGenerationStrategy>

價值產生策略。

fromDataAnnotation
Boolean

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

傳回

true 如果指定的值可以設定為預設值產生策略,則為 。

備註

如需詳細資訊和範例,請參閱使用 EF Core建立實體類型和關聯性的模型化,以及存取SQL Server和Azure SQL資料庫

適用於

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

傳回值,指出指定的值是否可以設定為特定資料表的值產生策略。

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

參數

propertyBuilder
IConventionPropertyBuilder

要設定之屬性的產生器。

valueGenerationStrategy
Nullable<SqlServerValueGenerationStrategy>

價值產生策略。

storeObject
StoreObjectIdentifier

資料表識別碼。

fromDataAnnotation
Boolean

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

傳回

true 如果指定的值可以設定為預設值產生策略,則為 。

備註

如需詳細資訊和範例,請參閱使用 EF Core建立實體類型和關聯性的模型化,以及存取SQL Server和Azure SQL資料庫

適用於