Udostępnij za pośrednictwem


SqlServerPropertyBuilderExtensions.HasValueGenerationStrategy Metoda

Definicja

Przeciążenia

HasValueGenerationStrategy(IConventionPropertyBuilder, Nullable<SqlServerValueGenerationStrategy>, Boolean)

Konfiguruje strategię generowania wartości dla właściwości klucza podczas określania wartości docelowej SQL Server.

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

Konfiguruje strategię generowania wartości dla właściwości klucza podczas określania wartości docelowej SQL Server dla określonej tabeli.

HasValueGenerationStrategy(IConventionPropertyBuilder, Nullable<SqlServerValueGenerationStrategy>, Boolean)

Konfiguruje strategię generowania wartości dla właściwości klucza podczas określania wartości docelowej 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

Parametry

propertyBuilder
IConventionPropertyBuilder

Konstruktor dla konfigurowanej właściwości.

valueGenerationStrategy
Nullable<SqlServerValueGenerationStrategy>

Strategia generowania wartości.

fromDataAnnotation
Boolean

Wskazuje, czy konfiguracja została określona przy użyciu adnotacji danych.

Zwraca

To samo wystąpienie konstruktora, jeśli konfiguracja została zastosowana, null w przeciwnym razie.

Uwagi

Aby uzyskać więcej informacji, zobacz Modelowanie typów jednostek i relacji oraz Uzyskiwanie dostępu do baz danych SQL Server i Azure SQL za pomocą programu EF Core.

Dotyczy

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

Konfiguruje strategię generowania wartości dla właściwości klucza podczas określania wartości docelowej SQL Server dla określonej tabeli.

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

Parametry

propertyBuilder
IConventionPropertyBuilder

Konstruktor dla konfigurowanej właściwości.

valueGenerationStrategy
Nullable<SqlServerValueGenerationStrategy>

Strategia generowania wartości.

storeObject
StoreObjectIdentifier

Identyfikator tabeli.

fromDataAnnotation
Boolean

Wskazuje, czy konfiguracja została określona przy użyciu adnotacji danych.

Zwraca

To samo wystąpienie konstruktora, jeśli konfiguracja została zastosowana, null w przeciwnym razie.

Uwagi

Aby uzyskać więcej informacji, zobacz Modelowanie typów jednostek i relacji oraz Uzyskiwanie dostępu do baz danych SQL Server i Azure SQL za pomocą programu EF Core.

Dotyczy