Table of Contents

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
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

InternalCheckConstraintBuilder

Metadata

The check constraint being configured.

public virtual IMutableCheckConstraint Metadata { get; }

Property Value

IMutableCheckConstraint

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 string

The key of the annotation to be added or updated.

value object

The 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 string

The 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.