Share via


SqlServerPropertyBuilderExtensions.CanSetIdentityColumnIncrement 方法

定义

重载

CanSetIdentityColumnIncrement(IConventionPropertyBuilder, Nullable<Int32>, Boolean)

返回一个值,该值指示是否可以将给定值设置为SQL Server IDENTITY 的增量。

CanSetIdentityColumnIncrement(IConventionPropertyBuilder, Nullable<Int32>, StoreObjectIdentifier, Boolean)

返回一个值,该值指示是否可以将给定值设置为特定表SQL Server IDENTITY 的增量。

CanSetIdentityColumnIncrement(IConventionPropertyBuilder, Nullable<Int32>, Boolean)

返回一个值,该值指示是否可以将给定值设置为SQL Server IDENTITY 的增量。

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

参数

propertyBuilder
IConventionPropertyBuilder

要配置的属性的生成器。

increment
Nullable<Int32>

添加到已加载的上一行的标识值的增量值。

fromDataAnnotation
Boolean

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

返回

true如果给定值可以设置为 SQL Server IDENTITY 的默认增量,则为 。

注解

有关详细信息和示例,请参阅为实体类型和关系建模和使用 EF Core 访问SQL Server和Azure SQL数据库

适用于

CanSetIdentityColumnIncrement(IConventionPropertyBuilder, Nullable<Int32>, StoreObjectIdentifier, Boolean)

返回一个值,该值指示是否可以将给定值设置为特定表SQL Server IDENTITY 的增量。

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

参数

propertyBuilder
IConventionPropertyBuilder

要配置的属性的生成器。

increment
Nullable<Int32>

添加到已加载的上一行的标识值的增量值。

storeObject
StoreObjectIdentifier

表标识符。

fromDataAnnotation
Boolean

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

返回

true如果给定值可以设置为 SQL Server IDENTITY 的默认增量,则为 。

注解

有关详细信息和示例,请参阅为实体类型和关系建模和使用 EF Core 访问SQL Server和Azure SQL数据库

适用于