Table of Contents

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

IConventionCheckConstraint

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 string

The database name of the check constraint.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

bool

true if the database name can be set for the check constraint.

HasName(string?, bool)

Sets the database name of the check constraint.

IConventionCheckConstraintBuilder? HasName(string? name, bool fromDataAnnotation = false)

Parameters

name string

The database name of the check constraint.

fromDataAnnotation bool

Indicates whether the configuration was specified using a data annotation.

Returns

IConventionCheckConstraintBuilder

The same builder instance if the configuration was applied, null otherwise.