Share via


RelationalPropertyBuilderExtensions.CanSetDefaultValueSql Method

Definition

Returns a value indicating whether the given default value expression can be set for the column.

public static bool CanSetDefaultValueSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string sql, bool fromDataAnnotation = false);
public static bool CanSetDefaultValueSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? sql, bool fromDataAnnotation = false);
static member CanSetDefaultValueSql : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * string * bool -> bool
<Extension()>
Public Function CanSetDefaultValueSql (propertyBuilder As IConventionPropertyBuilder, sql As String, Optional fromDataAnnotation As Boolean = false) As Boolean

Parameters

propertyBuilder
IConventionPropertyBuilder

The builder for the property being configured.

sql
String

The SQL expression for the default value of the column.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

true if the given default value expression can be set for the column.

Remarks

See Database default values for more information and examples.

Applies to