Share via


RelationalPropertyExtensions.SetDefaultValue Method

Definition

Overloads

SetDefaultValue(IMutableProperty, Object)

Sets the object that is used as the default value for the column this property is mapped to.

SetDefaultValue(IConventionProperty, Object, Boolean)

Sets the object that is used as the default value for the column this property is mapped to.

SetDefaultValue(IMutableProperty, Object)

Sets the object that is used as the default value for the column this property is mapped to.

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)

Parameters

property
IMutableProperty

The property.

value
Object

The value to set.

Applies to

SetDefaultValue(IConventionProperty, Object, Boolean)

Sets the object that is used as the default value for the column this property is mapped to.

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

Parameters

property
IConventionProperty

The property.

value
Object

The value to set.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Applies to