Table of Contents

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

entityType Type
tableName string
columns IReadOnlyList<RelationalColumn>
key RelationalColumn
keyIsGenerated bool
concurrencyToken RelationalColumn
navigations IReadOnlyList<RelationalNavigation>
searchColumns IReadOnlyList<RelationalSearchColumn>
keys IReadOnlyList<RelationalColumn>
clusteringColumns IReadOnlyList<RelationalClusteringColumn>

Properties

ClusteringColumns

The ordered-read columns (a multi-column index materializes them).

public IReadOnlyList<RelationalClusteringColumn> ClusteringColumns { get; }

Property Value

IReadOnlyList<RelationalClusteringColumn>

Columns

Every mapped column.

public IReadOnlyList<RelationalColumn> Columns { get; }

Property Value

IReadOnlyList<RelationalColumn>

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

RelationalColumn

EntityType

The entity type.

public Type EntityType { get; }

Property Value

Type

HasCompositeKey

Whether the key spans more than one column.

public bool HasCompositeKey { get; }

Property Value

bool

Key

The key column (the first one when the key is composite — see Keys).

public RelationalColumn Key { get; }

Property Value

RelationalColumn

KeyIsGenerated

Whether the key is database-generated (identity): inserts omit it and read it back.

public bool KeyIsGenerated { get; }

Property Value

bool

Keys

The key columns, in declared order (one for a simple key; several for Key(x => new { … })).

public IReadOnlyList<RelationalColumn> Keys { get; }

Property Value

IReadOnlyList<RelationalColumn>

Navigations

The declared navigations (foreign-key overrides); undeclared ones resolve by convention.

public IReadOnlyList<RelationalNavigation> Navigations { get; }

Property Value

IReadOnlyList<RelationalNavigation>

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

IReadOnlyList<RelationalSearchColumn>

TableName

The table name.

public string TableName { get; }

Property Value

string

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

memberName string

Returns

RelationalColumn

NavigationFor(string)

Resolves a declared navigation by member name, or null — conventions apply then.

public RelationalNavigation? NavigationFor(string memberName)

Parameters

memberName string

Returns

RelationalNavigation