RelationalComplexTypePropertyBuilderExtensions.HasComputedColumnSql 方法

定義

多載

HasComputedColumnSql(ComplexTypePropertyBuilder)

設定屬性,以關係資料庫為目標時對應至計算資料行。

HasComputedColumnSql(ComplexTypePropertyBuilder, String)

設定屬性,以關係資料庫為目標時對應至計算資料行。

HasComputedColumnSql(ComplexTypePropertyBuilder, String, Nullable<Boolean>)

設定屬性,以關係資料庫為目標時對應至計算資料行。

HasComputedColumnSql<TProperty>(ComplexTypePropertyBuilder<TProperty>, String)

設定屬性,以關係資料庫為目標時對應至計算資料行。

HasComputedColumnSql<TProperty>(ComplexTypePropertyBuilder<TProperty>, String, Nullable<Boolean>)

設定屬性,以關係資料庫為目標時對應至計算資料行。

HasComputedColumnSql<TProperty>(ComplexTypePropertyBuilder<TProperty>)

設定屬性,以關係資料庫為目標時對應至計算資料行。

HasComputedColumnSql(ComplexTypePropertyBuilder)

設定屬性,以關係資料庫為目標時對應至計算資料行。

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

參數

propertyBuilder
ComplexTypePropertyBuilder

要設定之屬性的產生器。

傳回

相同的產生器實例,以便鏈結多個呼叫。

備註

在沒有引數的情況下呼叫時,此方法會告訴 EF 計算資料行,而不需要指定用來計算它的實際 SQL。 將 EF 對應至現有資料庫時,這非常有用。

如需詳細資訊和範例,請參閱 資料庫預設值

適用於

HasComputedColumnSql(ComplexTypePropertyBuilder, String)

設定屬性,以關係資料庫為目標時對應至計算資料行。

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

參數

propertyBuilder
ComplexTypePropertyBuilder

要設定之屬性的產生器。

sql
String

計算資料行值的 SQL 運算式。

傳回

相同的產生器實例,以便鏈結多個呼叫。

備註

如需詳細資訊和範例,請參閱 資料庫預設值

適用於

HasComputedColumnSql(ComplexTypePropertyBuilder, String, Nullable<Boolean>)

設定屬性,以關係資料庫為目標時對應至計算資料行。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasComputedColumnSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder propertyBuilder, string? sql, bool? stored);
static member HasComputedColumnSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder * string * Nullable<bool> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
<Extension()>
Public Function HasComputedColumnSql (propertyBuilder As ComplexTypePropertyBuilder, sql As String, stored As Nullable(Of Boolean)) As ComplexTypePropertyBuilder

參數

propertyBuilder
ComplexTypePropertyBuilder

要設定之屬性的產生器。

sql
String

計算資料行值的 SQL 運算式。

stored
Nullable<Boolean>

如果 true 為 ,則會根據資料列修改計算計算值,並儲存在資料庫中,例如一般資料行。 如果 false 為 ,則此值會在讀取值時計算,且不會佔用任何實際儲存體。 null 選取資料庫提供者預設值。

傳回

相同的產生器實例,以便鏈結多個呼叫。

備註

如需詳細資訊和範例,請參閱 資料庫預設值

適用於

HasComputedColumnSql<TProperty>(ComplexTypePropertyBuilder<TProperty>, String)

設定屬性,以關係資料庫為目標時對應至計算資料行。

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

類型參數

TProperty

正在設定之屬性的型別。

參數

propertyBuilder
ComplexTypePropertyBuilder<TProperty>

要設定之屬性的產生器。

sql
String

計算資料行值的 SQL 運算式。

傳回

相同的產生器實例,以便鏈結多個呼叫。

備註

如需詳細資訊和範例,請參閱 資料庫預設值

適用於

HasComputedColumnSql<TProperty>(ComplexTypePropertyBuilder<TProperty>, String, Nullable<Boolean>)

設定屬性,以關係資料庫為目標時對應至計算資料行。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<TProperty> HasComputedColumnSql<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<TProperty> propertyBuilder, string? sql, bool? stored);
static member HasComputedColumnSql : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<'Property> * string * Nullable<bool> -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<'Property>
<Extension()>
Public Function HasComputedColumnSql(Of TProperty) (propertyBuilder As ComplexTypePropertyBuilder(Of TProperty), sql As String, stored As Nullable(Of Boolean)) As ComplexTypePropertyBuilder(Of TProperty)

類型參數

TProperty

正在設定之屬性的型別。

參數

propertyBuilder
ComplexTypePropertyBuilder<TProperty>

要設定之屬性的產生器。

sql
String

計算資料行值的 SQL 運算式。

stored
Nullable<Boolean>

如果 true 為 ,則會根據資料列修改計算計算值,並儲存在資料庫中,例如一般資料行。 如果 false 為 ,則此值會在讀取值時計算,且不會佔用任何實際儲存體。 null 選取資料庫提供者預設值。

傳回

相同的產生器實例,以便鏈結多個呼叫。

備註

如需詳細資訊和範例,請參閱 資料庫預設值

適用於

HasComputedColumnSql<TProperty>(ComplexTypePropertyBuilder<TProperty>)

設定屬性,以關係資料庫為目標時對應至計算資料行。

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

類型參數

TProperty

正在設定之屬性的型別。

參數

propertyBuilder
ComplexTypePropertyBuilder<TProperty>

要設定之屬性的產生器。

傳回

相同的產生器實例,以便鏈結多個呼叫。

備註

在沒有引數的情況下呼叫時,此方法會告訴 EF 計算資料行,而不需要指定用來計算它的實際 SQL。 將 EF 對應至現有資料庫時,這非常有用。

如需詳細資訊和範例,請參閱 資料庫預設值

適用於