Język

SqlServerPropertyBuilderExtensions.HasDefaultValueSql Metoda

Definicja

Przeciążenia

Nazwisko Opis
HasDefaultValueSql(PropertyBuilder, String, String)

Konfiguruje domyślne wyrażenie wartości dla kolumny mapowania właściwości na wartość docelową SQL Server.

HasDefaultValueSql(IConventionPropertyBuilder, String, String, Boolean)

Konfiguruje domyślne wyrażenie wartości dla kolumny mapowania właściwości na wartość docelową SQL Server.

HasDefaultValueSql<TProperty>(PropertyBuilder<TProperty>, String, String)

Konfiguruje domyślne wyrażenie wartości dla kolumny mapowania właściwości na wartość docelową SQL Server.

HasDefaultValueSql(PropertyBuilder, String, String)

Źródło:
SqlServerPropertyBuilderExtensions.cs
Źródło:
SqlServerPropertyBuilderExtensions.cs

Konfiguruje domyślne wyrażenie wartości dla kolumny mapowania właściwości na wartość docelową SQL Server.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasDefaultValueSql(this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string? sql, string defaultConstraintName);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder * string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
<Extension()>
Public Function HasDefaultValueSql (propertyBuilder As PropertyBuilder, sql As String, defaultConstraintName As String) As PropertyBuilder

Parametry

propertyBuilder
PropertyBuilder

Konstruktor dla konfigurowanej właściwości.

sql
String

Wyrażenie SQL dla wartości domyślnej kolumny.

defaultConstraintName
String

Domyślna nazwa ograniczenia.

Zwraca

To samo wystąpienie konstruktora, aby można było połączyć w łańcuch wiele wywołań.

Uwagi

Aby uzyskać więcej informacji i przykładów, 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

HasDefaultValueSql(IConventionPropertyBuilder, String, String, Boolean)

Źródło:
SqlServerPropertyBuilderExtensions.cs
Źródło:
SqlServerPropertyBuilderExtensions.cs

Konfiguruje domyślne wyrażenie wartości dla kolumny mapowania właściwości na wartość docelową SQL Server.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasDefaultValueSql(this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? sql, string defaultConstraintName, bool fromDataAnnotation = false);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * string * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
<Extension()>
Public Function HasDefaultValueSql (propertyBuilder As IConventionPropertyBuilder, sql As String, defaultConstraintName As String, Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

Parametry

propertyBuilder
IConventionPropertyBuilder

Konstruktor dla konfigurowanej właściwości.

sql
String

Wyrażenie SQL dla wartości domyślnej kolumny.

defaultConstraintName
String

Domyślna nazwa ograniczenia.

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 i przykładów, 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

HasDefaultValueSql<TProperty>(PropertyBuilder<TProperty>, String, String)

Źródło:
SqlServerPropertyBuilderExtensions.cs
Źródło:
SqlServerPropertyBuilderExtensions.cs

Konfiguruje domyślne wyrażenie wartości dla kolumny mapowania właściwości na wartość docelową SQL Server.

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> HasDefaultValueSql<TProperty>(this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string? sql, string defaultConstraintName);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property> * string * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property>
<Extension()>
Public Function HasDefaultValueSql(Of TProperty) (propertyBuilder As PropertyBuilder(Of TProperty), sql As String, defaultConstraintName As String) As PropertyBuilder(Of TProperty)

Parametry typu

TProperty

Typ konfigurowanej właściwości.

Parametry

propertyBuilder
PropertyBuilder<TProperty>

Konstruktor dla konfigurowanej właściwości.

sql
String

Wyrażenie SQL dla wartości domyślnej kolumny.

defaultConstraintName
String

Domyślna nazwa ograniczenia.

Zwraca

To samo wystąpienie konstruktora, aby można było połączyć w łańcuch wiele wywołań.

Uwagi

Aby uzyskać więcej informacji i przykładów, 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