Interface IConventionCheckConstraintBuilder
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Builders
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Provides a simple API for configuring a check constraint.
public interface IConventionCheckConstraintBuilder : IConventionAnnotatableBuilder
Remarks
See Model building conventions and Database check constraints for more information and examples.
Properties
Metadata
The check constraint being configured.
IConventionCheckConstraint Metadata { get; }
Property Value
Methods
CanSetName(string?, bool)
Returns a value indicating whether the given name can be set for the check constraint.
bool CanSetName(string? name, bool fromDataAnnotation = false)
Parameters
name
stringThe database name of the check constraint.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
HasName(string?, bool)
Sets the database name of the check constraint.
IConventionCheckConstraintBuilder? HasName(string? name, bool fromDataAnnotation = false)
Parameters
name
stringThe database name of the check constraint.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionCheckConstraintBuilder
The same builder instance if the configuration was applied, null otherwise.