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 映射到现有数据库时,这非常有用。

有关详细信息和示例,请参阅 数据库默认值

适用于