Table of Contents

Installation

Add the nextorm core package plus one database-provider package to a net10.0 or net11.0 project, then use the NextORM.Core types from code.

Prerequisites: A project targeting net10.0 or net11.0.

Overview

NextORM is split into a small, driver-free core package and one package per relational provider:

  • nextorm (assembly nextorm.core) contains the query builder and compiler, entity metadata, the dependency-injection helpers, the plan cache and the in-memory provider (InMemoryDataContext). It references Microsoft.Extensions.DependencyInjection, Microsoft.Extensions.Logging and Microsoft.Extensions.ObjectPool, but no database driver.
  • nextorm.sqlite, nextorm.sqlserver, nextorm.postgres, nextorm.mysql, nextorm.mariadb and nextorm.clickhouse each add one concrete context (SqliteDataContext, SqlServerDataContext, PostgresDataContext, MySqlDataContext, MariaDbDataContext, ClickHouseDataContext) and a Use… registration extension. The provider packages depend on nextorm transitively.
  • nextorm.extensions is an optional product package that adds the query-component operators SelectWhereMin / SelectWhereMax and SelectGroup / SelectGroupHaving on top of the public query-component layer. It references nextorm.core only, needs no provider package of its own and works with every provider; see Extensions package.
  • nextorm.entityframeworkcore is an optional bridge package that runs nextorm queries and commands over an existing EF Core DbContext connection and transaction, reusing the EF model mapping (db.CreateNextOrmContext()); see EF Core integration.

1.0.9 is the first stable release, so the install commands below no longer need --prerelease. Preview builds (1.0.10-a.x and later) still do.

Install the core package

dotnet add package nextorm

Then add exactly one provider package for the database you target:

dotnet add package nextorm.sqlite
dotnet add package nextorm.sqlserver
dotnet add package nextorm.postgres
dotnet add package nextorm.mysql
dotnet add package nextorm.mariadb
dotnet add package nextorm.clickhouse

The nextorm.extensions package is optional. Add it when you need the component-based SelectWhereMin / SelectWhereMax or the inferred-grouping SelectGroup / SelectGroupHaving; it works with any provider:

dotnet add package nextorm.extensions

The nextorm.entityframeworkcore package is optional as well — add it when an application already has an EF Core DbContext and you want nextorm queries over the same connection:

dotnet add package nextorm.entityframeworkcore

The Package Manager Console equivalent:

Install-Package nextorm
Install-Package nextorm.sqlite

Package reference

Package Package ID Adds Driver
Core nextorm Query engine, metadata, DI, in-memory provider —
SQLite nextorm.sqlite SqliteDataContext, UseSqlite Microsoft.Data.Sqlite
SQL Server nextorm.sqlserver SqlServerDataContext, UseSqlServer Microsoft.Data.SqlClient
PostgreSQL nextorm.postgres PostgresDataContext, UsePostgres Npgsql
MySQL nextorm.mysql MySqlDataContext, UseMySql MySqlConnector
MariaDB nextorm.mariadb MariaDbDataContext, UseMariaDb MySqlConnector
ClickHouse nextorm.clickhouse ClickHouseDataContext, UseClickHouse ClickHouse.Driver
Extensions (optional) nextorm.extensions SelectWhereMin / SelectWhereMax and SelectGroup / SelectGroupHaving, on top of nextorm.core —
EF Core (optional) nextorm.entityframeworkcore CreateNextOrmContext — nextorm queries over an existing DbContext connection and transaction Microsoft.EntityFrameworkCore.Relational

The in-memory provider lives in the core package, so it is available without installing a provider.

Target framework

The packages multi-target net10.0 and net11.0, so NuGet resolves the asset that matches the consuming project, and enable implicit usings and nullable reference types. A PackageReference looks like this:

<ItemGroup>
  <PackageReference Include="nextorm" Version="1.0.9" />
  <PackageReference Include="nextorm.sqlite" Version="1.0.9" />
</ItemGroup>

For a preview build, float to the newest prerelease with Version="*-*".


Source: docs/index.md:91; src/nextorm.core/nextorm.core.csproj:4; src/nextorm.sqlite/nextorm.sqlite.csproj:7; src/nextorm.sqlserver/nextorm.sqlserver.csproj:16; src/nextorm.postgres/nextorm.postgres.csproj:8; in-memory availability: tests/nextorm.core.tests/DependencyInjection/DependencyInjectionTests.cs:16.