Class CheckConstraintBuilder
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Builders
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Provides a simple API for configuring a check constraint.
public class CheckConstraintBuilder : IInfrastructure<IConventionCheckConstraintBuilder>
- Inheritance
-
CheckConstraintBuilder
- Implements
-
IInfrastructure<IConventionCheckConstraintBuilder>
- Inherited Members
Remarks
See Database check constraints for more information and examples.
Constructors
CheckConstraintBuilder(IMutableCheckConstraint)
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public CheckConstraintBuilder(IMutableCheckConstraint checkConstraint)
Parameters
checkConstraint
IMutableCheckConstraint
Properties
Builder
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
protected virtual InternalCheckConstraintBuilder Builder { get; }
Property Value
Metadata
The check constraint being configured.
public virtual IMutableCheckConstraint Metadata { get; }
Property Value
Methods
HasAnnotation(string, object?)
Adds or updates an annotation on the check constraint. If an annotation with the key specified in annotation
already exists, its value will be updated.
public virtual CheckConstraintBuilder HasAnnotation(string annotation, object? value)
Parameters
annotation
stringThe key of the annotation to be added or updated.
value
objectThe value to be stored in the annotation.
Returns
- CheckConstraintBuilder
The same builder instance so that multiple configuration calls can be chained.
HasName(string)
Sets the database name of the check constraint.
public virtual CheckConstraintBuilder HasName(string name)
Parameters
name
stringThe database name of the check constraint.
Returns
- CheckConstraintBuilder
The same builder instance so that multiple configuration calls can be chained.
Remarks
See Database check constraints for more information and examples.