Interface IUniqueConstraint
- Namespace
- Microsoft.EntityFrameworkCore.Metadata
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Represents a unique constraint.
public interface IUniqueConstraint : IAnnotatable, IReadOnlyAnnotatable
Remarks
See Modeling entity types and relationships for more information and examples.
Properties
Columns
Gets the columns that are participating in the unique constraint.
IReadOnlyList<IColumn> Columns { get; }
Property Value
MappedKeys
Gets the mapped keys.
IEnumerable<IKey> MappedKeys { get; }
Property Value
- IEnumerable<IKey>
Name
Gets the name of the unique constraint.
string Name { get; }
Property Value
Table
Gets the table on with the unique constraint is declared.
ITable Table { get; }
Property Value
Methods
GetIsPrimaryKey()
Gets a value indicating whether this constraint is the primary key.
bool GetIsPrimaryKey()
Returns
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
MetadataDebugStringOptionsOptions for generating the string.
indent
intThe number of indent spaces to use before each new line.
Returns
- string
A human-readable representation.