Interface ITable
- Namespace
- Microsoft.EntityFrameworkCore.Metadata
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Represents a table in the database.
public interface ITable : ITableBase, IAnnotatable, IReadOnlyAnnotatable
- Inherited Members
Remarks
See Modeling entity types and relationships for more information and examples.
Properties
CheckConstraints
Gets the check constraints for this table.
IEnumerable<ICheckConstraint> CheckConstraints { get; }
Property Value
Columns
Gets the columns defined for this table.
IEnumerable<IColumn> Columns { get; }
Property Value
Comment
Gets the comment for this table.
string? Comment { get; }
Property Value
EntityTypeMappings
Gets the entity type mappings.
IEnumerable<ITableMapping> EntityTypeMappings { get; }
Property Value
ForeignKeyConstraints
Gets the foreign key constraints for this table.
IEnumerable<IForeignKeyConstraint> ForeignKeyConstraints { get; }
Property Value
Indexes
Gets the indexes for this table.
IEnumerable<ITableIndex> Indexes { get; }
Property Value
IsExcludedFromMigrations
Gets the value indicating whether the table should be managed by migrations
bool IsExcludedFromMigrations { get; }
Property Value
PrimaryKey
Gets the primary key for this table.
IPrimaryKeyConstraint? PrimaryKey { get; }
Property Value
ReferencingForeignKeyConstraints
Gets the foreign key constraints referencing this table.
IEnumerable<IForeignKeyConstraint> ReferencingForeignKeyConstraints { get; }
Property Value
Triggers
Gets the triggers for this table.
IEnumerable<ITrigger> Triggers { get; }
Property Value
- IEnumerable<ITrigger>
UniqueConstraints
Gets the unique constraints including the primary key for this table.
IEnumerable<IUniqueConstraint> UniqueConstraints { get; }
Property Value
Methods
FindColumn(IProperty)
Gets the column mapped to the given property. Returns null if no column is mapped to the given property.
IColumn? FindColumn(IProperty property)
Parameters
property
IProperty
Returns
FindColumn(string)
Gets the column with a given name. Returns null if no column with the given name is defined.
IColumn? FindColumn(string name)
Parameters
name
string
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.