RelationalPropertyExtensions.SetDefaultValue 方法

定义

重载

SetDefaultValue(IMutableProperty, Object)

设置对象,该对象用作此属性映射到的列的默认值。

SetDefaultValue(IConventionProperty, Object, Boolean)

设置对象,该对象用作此属性映射到的列的默认值。

SetDefaultValue(IMutableProperty, Object)

设置对象,该对象用作此属性映射到的列的默认值。

public static void SetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property, object value);
public static void SetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property, object? value);
static member SetDefaultValue : Microsoft.EntityFrameworkCore.Metadata.IMutableProperty * obj -> unit
<Extension()>
Public Sub SetDefaultValue (property As IMutableProperty, value As Object)

参数

property
IMutableProperty

属性。

value
Object

要设置的值。

适用于

SetDefaultValue(IConventionProperty, Object, Boolean)

设置对象,该对象用作此属性映射到的列的默认值。

public static void SetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, object value, bool fromDataAnnotation = false);
public static object SetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, object value, bool fromDataAnnotation = false);
public static object? SetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, object? value, bool fromDataAnnotation = false);
static member SetDefaultValue : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * obj * bool -> unit
static member SetDefaultValue : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * obj * bool -> obj
<Extension()>
Public Sub SetDefaultValue (property As IConventionProperty, value As Object, Optional fromDataAnnotation As Boolean = false)
<Extension()>
Public Function SetDefaultValue (property As IConventionProperty, value As Object, Optional fromDataAnnotation As Boolean = false) As Object

参数

property
IConventionProperty

属性。

value
Object

要设置的值。

fromDataAnnotation
Boolean

指示配置是否是使用数据注释指定的。

返回

配置的值。

适用于