Table of Contents

Class NextOrmModelMapper

Namespace
NextORM.EntityFrameworkCore
Assembly
nextorm.entityframeworkcore.dll

Reads an EF Core IModel and registers the resulting entity mapping in nextorm's process-wide metadata cache, so that nextorm queries over the same CLR types address the table and columns declared in the EF model.

public static class NextOrmModelMapper
Inheritance
NextOrmModelMapper
Inherited Members

Remarks

The mapping is derived from the EF model alone: no nextorm attribute or fluent configuration is required on the entity. Properties without a CLR member (shadow properties) and owned types are skipped. Because Metadata is process-wide and keyed by Type, at most one mapping per CLR type is kept; a later registration for the same type replaces the previous one only when it is identical, and otherwise throws.

The global query filters declared in the EF model are imported too: NextORM.EntityFrameworkCore.EfQueryFilterTranslator turns each named/keyed and anonymous EF filter into a nextorm filter reading its live owning DbContext through NextORM.EntityFrameworkCore.EfCoreFilterBinding. Every entity's mapping and filters are translated and staged first; under the process-wide metadata registration gate the current entries are re-read, the merge is recomputed and conflicts revalidated immediately before publication, and a failure restores the prior entries / removes the newly added ones. Import is failure-atomic: failed publication preserves prior metadata. Concurrent-reader snapshot atomicity is not guaranteed.

Methods

Register(IModel)

Builds nextorm entity metadata for every relational type of model and writes it to Metadata, keyed by the entity CLR type.

public static void Register(IModel model)

Parameters

model IModel

The EF Core model to map.

Exceptions

ArgumentNullException

model is null.

NotSupportedException

The model uses a shape the integration cannot represent: an untranslatable global query filter, EF inheritance (TPH/TPT/TPC), or a schema-qualified table. Mapping it would silently produce wrong SQL.

InvalidOperationException

A CLR type is already mapped to a different table/column layout, or an imported named filter collides with an existing registration. The process-wide metadata cache holds one mapping per type; call Clear() to reset it.