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)

Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs

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

C#
public static void SetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property, object value);
C#
public static void SetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property, object? value);

Parameters

property
IMutableProperty

The property.

value
Object

The value to set.

Applies to

Entity Framework Core 9.0 i druge verzije
Proizvod Verzije
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

SetDefaultValue(IConventionProperty, Object, Boolean)

Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs
Source:
RelationalPropertyExtensions.cs

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

C#
public static void SetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, object value, bool fromDataAnnotation = false);
C#
public static object SetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, object value, bool fromDataAnnotation = false);
C#
public static object? SetDefaultValue (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, object? value, bool fromDataAnnotation = false);

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

Entity Framework Core 9.0 i druge verzije
Proizvod Verzije
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0