RelationalEntityTypeBuilderExtensions.CanSetCheckConstraint Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Caution
Use CanHaveCheckConstraint
Returns a value indicating whether the check constraint can be configured.
public static bool CanSetCheckConstraint (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string name, string sql, bool fromDataAnnotation = false);
[System.Obsolete("Use CanHaveCheckConstraint")]
public static bool CanSetCheckConstraint (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string name, string? sql, bool fromDataAnnotation = false);
static member CanSetCheckConstraint : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder * string * string * bool -> bool
[<System.Obsolete("Use CanHaveCheckConstraint")>]
static member CanSetCheckConstraint : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder * string * string * bool -> bool
<Extension()>
Public Function CanSetCheckConstraint (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.
- Attributes
Remarks
See Database check constraints for more information.
Applies to
Entity Framework