RelationalComplexTypePropertyBuilderExtensions.HasDefaultValue 方法

定义

重载

HasDefaultValue(ComplexTypePropertyBuilder)

配置属性在面向关系数据库时映射到的列的默认值。

HasDefaultValue(ComplexTypePropertyBuilder, Object)

配置属性在面向关系数据库时映射到的列的默认值。

HasDefaultValue<TProperty>(ComplexTypePropertyBuilder<TProperty>)

配置属性在面向关系数据库时映射到的列的默认值。

HasDefaultValue<TProperty>(ComplexTypePropertyBuilder<TProperty>, Object)

配置属性在面向关系数据库时映射到的列的默认值。

HasDefaultValue(ComplexTypePropertyBuilder)

配置属性在面向关系数据库时映射到的列的默认值。

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

参数

propertyBuilder
ComplexTypePropertyBuilder

要配置的属性的生成器。

返回

同一生成器实例,以便可以链接多个调用。

注解

在没有参数的情况下调用时,此方法会告知 EF 列具有某种类型的默认值约束,而无需确切指定它是什么。 将 EF 映射到现有数据库时,这非常有用。

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

适用于

HasDefaultValue(ComplexTypePropertyBuilder, Object)

配置属性在面向关系数据库时映射到的列的默认值。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder HasDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder propertyBuilder, object? value);
static member HasDefaultValue : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder * obj -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder
<Extension()>
Public Function HasDefaultValue (propertyBuilder As ComplexTypePropertyBuilder, value As Object) As ComplexTypePropertyBuilder

参数

propertyBuilder
ComplexTypePropertyBuilder

要配置的属性的生成器。

value
Object

列的默认值。

返回

同一生成器实例,以便可以链接多个调用。

注解

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

适用于

HasDefaultValue<TProperty>(ComplexTypePropertyBuilder<TProperty>)

配置属性在面向关系数据库时映射到的列的默认值。

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

类型参数

TProperty

要配置的属性的类型。

参数

propertyBuilder
ComplexTypePropertyBuilder<TProperty>

要配置的属性的生成器。

返回

同一生成器实例,以便可以链接多个调用。

注解

在没有参数的情况下调用时,此方法会告知 EF 列具有某种类型的默认值约束,而无需确切指定它是什么。 将 EF 映射到现有数据库时,这非常有用。

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

适用于

HasDefaultValue<TProperty>(ComplexTypePropertyBuilder<TProperty>, Object)

配置属性在面向关系数据库时映射到的列的默认值。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<TProperty> HasDefaultValue<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<TProperty> propertyBuilder, object? value);
static member HasDefaultValue : Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<'Property> * obj -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<'Property>
<Extension()>
Public Function HasDefaultValue(Of TProperty) (propertyBuilder As ComplexTypePropertyBuilder(Of TProperty), value As Object) As ComplexTypePropertyBuilder(Of TProperty)

类型参数

TProperty

要配置的属性的类型。

参数

propertyBuilder
ComplexTypePropertyBuilder<TProperty>

要配置的属性的生成器。

value
Object

列的默认值。

返回

同一生成器实例,以便可以链接多个调用。

注解

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

适用于