RelationalPropertyExtensions.SetDefaultValueSql 方法

定义

重载

SetDefaultValueSql(IMutableProperty, String)

设置用作此属性映射到的列的默认值的 SQL 表达式。

SetDefaultValueSql(IConventionProperty, String, Boolean)

设置用作此属性映射到的列的默认值的 SQL 表达式。

SetDefaultValueSql(IMutableProperty, String)

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

设置用作此属性映射到的列的默认值的 SQL 表达式。

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)

参数

property
IMutableProperty

属性。

value
String

要设置的值。

适用于

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

设置用作此属性映射到的列的默认值的 SQL 表达式。

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

参数

property
IConventionProperty

属性。

value
String

要设置的值。

fromDataAnnotation
Boolean

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

返回

配置的值。

适用于