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.

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

Parameters

property
IMutableProperty

The property.

value
String

The value to set.

Applies to

Entity Framework Core 9.0 och andra versioner
Produkt Versioner
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

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.

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

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

Entity Framework Core 9.0 och andra versioner
Produkt Versioner
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0