Share via


SqlServerPropertyBuilderExtensions.ForSqlServerHasValueGenerationStrategy Method

Definition

Caution

Use HasValueGenerationStrategy

Configures the value generation strategy for the key property, when targeting 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

Parameters

propertyBuilder
IConventionPropertyBuilder

The builder for the property being configured.

valueGenerationStrategy
Nullable<SqlServerValueGenerationStrategy>

The value generation strategy.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Attributes

Applies to