Table of Contents

Interface IReadOnlyCheckConstraint

Namespace
Microsoft.EntityFrameworkCore.Metadata
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

Represents a check constraint on the entity type.

public interface IReadOnlyCheckConstraint : IReadOnlyAnnotatable

Remarks

See Database check constraints for more information and examples.

Properties

EntityType

Gets the entity type on which this check constraint is defined.

IReadOnlyEntityType EntityType { get; }

Property Value

IReadOnlyEntityType

ModelName

Gets the name of the check constraint in the model.

string ModelName { get; }

Property Value

string

Name

Gets the database name of the check constraint.

string? Name { get; }

Property Value

string

Sql

Gets the constraint sql used in a check constraint in the database.

string Sql { get; }

Property Value

string

Methods

GetDefaultName()

Returns the default database name that would be used for this check constraint.

string? GetDefaultName()

Returns

string

The default name that would be used for this check constraint.

GetDefaultName(in StoreObjectIdentifier)

Returns the default database name that would be used for this check constraint.

string? GetDefaultName(in StoreObjectIdentifier storeObject)

Parameters

storeObject StoreObjectIdentifier

The identifier of the store object.

Returns

string

The default name that would be used for this check constraint.

GetName(in StoreObjectIdentifier)

Gets the database name of the check constraint.

string? GetName(in StoreObjectIdentifier storeObject)

Parameters

storeObject StoreObjectIdentifier

The identifier of the store object.

Returns

string

The database name of the check constraint for the given store object.

ToDebugString(MetadataDebugStringOptions, int)

Creates a human-readable representation of the given metadata.

Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.

string ToDebugString(MetadataDebugStringOptions options = 0, int indent = 0)

Parameters

options MetadataDebugStringOptions

Options for generating the string.

indent int

The number of indent spaces to use before each new line.

Returns

string

A human-readable representation.