Share via


RelationalPropertyBuilderExtensions.CanSetComputedColumnSql Method

Definition

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

public static bool CanSetComputedColumnSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string sql, bool fromDataAnnotation = false);
public static bool CanSetComputedColumnSql (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? sql, bool fromDataAnnotation = false);
static member CanSetComputedColumnSql : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * string * bool -> bool
<Extension()>
Public Function CanSetComputedColumnSql (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 that computes values for the column.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

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

Remarks

See Database default values for more information and examples.

Applies to