Class RelationalEntityConfiguration
- Namespace
- eQuantic.Core.Data.Relational
- Assembly
- eQuantic.Core.Data.Relational.dll
The relational mapping for an entity: its table, key column, columns (named through the dialect's convention unless overridden) and whether the key is database-generated. Declared up front — the engine renders SQL from it and never spells a name by hand.
public abstract class RelationalEntityConfiguration
- Inheritance
-
RelationalEntityConfiguration
- Derived
- Inherited Members
Constructors
RelationalEntityConfiguration(Type, string, IReadOnlyList<RelationalColumn>, RelationalColumn, bool, RelationalColumn?, IReadOnlyList<RelationalNavigation>?, IReadOnlyList<RelationalSearchColumn>?, IReadOnlyList<RelationalColumn>?, IReadOnlyList<RelationalClusteringColumn>?)
Initializes the configuration.
protected RelationalEntityConfiguration(Type entityType, string tableName, IReadOnlyList<RelationalColumn> columns, RelationalColumn key, bool keyIsGenerated, RelationalColumn? concurrencyToken = null, IReadOnlyList<RelationalNavigation>? navigations = null, IReadOnlyList<RelationalSearchColumn>? searchColumns = null, IReadOnlyList<RelationalColumn>? keys = null, IReadOnlyList<RelationalClusteringColumn>? clusteringColumns = null)
Parameters
entityTypeTypetableNamestringcolumnsIReadOnlyList<RelationalColumn>keyRelationalColumnkeyIsGeneratedboolconcurrencyTokenRelationalColumnnavigationsIReadOnlyList<RelationalNavigation>searchColumnsIReadOnlyList<RelationalSearchColumn>keysIReadOnlyList<RelationalColumn>clusteringColumnsIReadOnlyList<RelationalClusteringColumn>
Properties
ClusteringColumns
The ordered-read columns (a multi-column index materializes them).
public IReadOnlyList<RelationalClusteringColumn> ClusteringColumns { get; }
Property Value
Columns
Every mapped column.
public IReadOnlyList<RelationalColumn> Columns { get; }
Property Value
ConcurrencyToken
The optimistic-concurrency column, or null: updates and deletes match it in the WHERE and bump
it, and a commit whose writes miss rows throws ConcurrencyConflictException.
public RelationalColumn? ConcurrencyToken { get; }
Property Value
EntityType
The entity type.
public Type EntityType { get; }
Property Value
HasCompositeKey
Whether the key spans more than one column.
public bool HasCompositeKey { get; }
Property Value
Key
The key column (the first one when the key is composite — see Keys).
public RelationalColumn Key { get; }
Property Value
KeyIsGenerated
Whether the key is database-generated (identity): inserts omit it and read it back.
public bool KeyIsGenerated { get; }
Property Value
Keys
The key columns, in declared order (one for a simple key; several for Key(x => new { … })).
public IReadOnlyList<RelationalColumn> Keys { get; }
Property Value
Navigations
The declared navigations (foreign-key overrides); undeclared ones resolve by convention.
public IReadOnlyList<RelationalNavigation> Navigations { get; }
Property Value
SearchColumns
The search-indexed text columns. Relational LIKE already pushes down without them — the
declaration is about the index: on PostgreSQL the migration materializes a GIN trigram index
(pg_trgm) so substring matches stop scanning; dialects without an equivalent ignore it (the
semantics never change, only the plan).
public IReadOnlyList<RelationalSearchColumn> SearchColumns { get; }
Property Value
TableName
The table name.
public string TableName { get; }
Property Value
Methods
ColumnFor(string)
Resolves a member (property) name to its column, or null when the member is not mapped.
public RelationalColumn? ColumnFor(string memberName)
Parameters
memberNamestring
Returns
NavigationFor(string)
Resolves a declared navigation by member name, or null — conventions apply then.
public RelationalNavigation? NavigationFor(string memberName)
Parameters
memberNamestring