Delen via


RelationalPropertyExtensions.SetDefaultValueSql Method

Definition

Overloads

SetDefaultValueSql(IMutableProperty, String)

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

SetDefaultValueSql(IConventionProperty, String, Boolean)

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

SetDefaultValueSql(IMutableProperty, String)

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

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

public static void SetDefaultValueSql (this Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property, string value);
public static void SetDefaultValueSql (this Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property, string? value);
static member SetDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.IMutableProperty * string -> unit
<Extension()>
Public Sub SetDefaultValueSql (property As IMutableProperty, value As String)

Parameters

property
IMutableProperty

The property.

value
String

The value to set.

Applies to

SetDefaultValueSql(IConventionProperty, String, Boolean)

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

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

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

Parameters

property
IConventionProperty

The property.

value
String

The value to set.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Applies to