RelationalEntityTypeBuilderExtensions.CanHaveCheckConstraint Method

Definition

Returns a value indicating whether the check constraint can be configured.

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

Parameters

entityTypeBuilder
IConventionEntityTypeBuilder

The builder for the entity type being configured.

name
String

The name of the check constraint.

sql
String

The logical constraint sql used in the check constraint.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

true if the configuration can be applied.

Remarks

See Database check constraints for more information and examples.

Applies to