語言

RelationalPropertyBuilderExtensions.HasDefaultValueSql 方法

定義

多載

名稱 Description
HasDefaultValueSql(IConventionPropertyBuilder, String, Boolean)

設定屬性在針對關聯式資料庫時所映射欄位的預設值表達式。

HasDefaultValueSql(PropertyBuilder, String)

設定屬性在針對關聯式資料庫時所映射欄位的預設值表達式。

HasDefaultValueSql(PropertyBuilder)

設定屬性在針對關聯式資料庫時所映射欄位的預設值表達式。

HasDefaultValueSql<TProperty>(PropertyBuilder<TProperty>)

設定屬性在針對關聯式資料庫時所映射欄位的預設值表達式。

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

設定屬性在針對關聯式資料庫時所映射欄位的預設值表達式。

HasDefaultValueSql(IConventionPropertyBuilder, String, Boolean)

來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs

設定屬性在針對關聯式資料庫時所映射欄位的預設值表達式。

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

參數

propertyBuilder
IConventionPropertyBuilder

正在配置的物業的建商。

sql
String

欄位預設值的 SQL 表達式。

fromDataAnnotation
Boolean

表示配置是否以資料註解方式指定。

傳回

如果設定是套用,則使用同一個建構者實例, null 否則。

備註

更多資訊與範例請參閱 資料庫預設值 。

適用於

HasDefaultValueSql(PropertyBuilder, String)

來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs

設定屬性在針對關聯式資料庫時所映射欄位的預設值表達式。

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

參數

propertyBuilder
PropertyBuilder

正在配置的物業的建商。

sql
String

欄位預設值的 SQL 表達式。

傳回

同一個建構實例,這樣可以串接多個呼叫。

備註

更多資訊與範例請參閱 資料庫預設值 。

適用於

HasDefaultValueSql(PropertyBuilder)

來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs

設定屬性在針對關聯式資料庫時所映射欄位的預設值表達式。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasDefaultValueSql(this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
<Extension()>
Public Function HasDefaultValueSql (propertyBuilder As PropertyBuilder) As PropertyBuilder

參數

propertyBuilder
PropertyBuilder

正在配置的物業的建商。

傳回

同一個建構實例,這樣可以串接多個呼叫。

備註

當無參數呼叫時,此方法會告訴 EF 欄位有某種預設值限制,無需具體說明。 這在將 EF 映射到現有資料庫時非常有用。

更多資訊與範例請參閱 資料庫預設值 。

適用於

HasDefaultValueSql<TProperty>(PropertyBuilder<TProperty>)

來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs

設定屬性在針對關聯式資料庫時所映射欄位的預設值表達式。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> HasDefaultValueSql<TProperty>(this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder);
static member HasDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property> -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property>
<Extension()>
Public Function HasDefaultValueSql(Of TProperty) (propertyBuilder As PropertyBuilder(Of TProperty)) As PropertyBuilder(Of TProperty)

類型參數

TProperty

配置的房產類型。

參數

propertyBuilder
PropertyBuilder<TProperty>

正在配置的物業的建商。

傳回

同一個建構實例,這樣可以串接多個呼叫。

備註

當無參數呼叫時,此方法會告訴 EF 欄位有某種預設值限制,無需具體說明。 這在將 EF 映射到現有資料庫時非常有用。

更多資訊與範例請參閱 資料庫預設值 。

適用於

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

來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs
來源:
RelationalPropertyBuilderExtensions.cs

設定屬性在針對關聯式資料庫時所映射欄位的預設值表達式。

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

類型參數

TProperty

配置的房產類型。

參數

propertyBuilder
PropertyBuilder<TProperty>

正在配置的物業的建商。

sql
String

欄位預設值的 SQL 表達式。

傳回

同一個建構實例,這樣可以串接多個呼叫。

備註

更多資訊與範例請參閱 資料庫預設值 。

適用於