NOF.Infrastructure
10.6.0
See the version list below for details.
dotnet add package NOF.Infrastructure --version 10.6.0
NuGet\Install-Package NOF.Infrastructure -Version 10.6.0
<PackageReference Include="NOF.Infrastructure" Version="10.6.0" />
<PackageVersion Include="NOF.Infrastructure" Version="10.6.0" />
<PackageReference Include="NOF.Infrastructure" />
paket add NOF.Infrastructure --version 10.6.0
#r "nuget: NOF.Infrastructure, 10.6.0"
#:package NOF.Infrastructure@10.6.0
#addin nuget:?package=NOF.Infrastructure&version=10.6.0
#tool nuget:?package=NOF.Infrastructure&version=10.6.0
NOF.Infrastructure
Unified infrastructure entry package for the NOF Framework.
Overview
NOF.Infrastructure provides the default runtime wiring for NOF applications, including:
- builder defaults and step orchestration
- in-memory cache and messaging riders
- EF Core integration through
UseDbContext<TDbContext>() - OpenTelemetry registration and transport middleware
- tenant-aware
NOFDbContextsupport - builder-scoped
TypeResolver - ambient
IMapper/IIdGeneratoractivation through scopedIDaemonService
This lets consumers reference one package/project while still getting the full default infrastructure setup.
Usage
Add a single reference to NOF.Infrastructure in host or infrastructure-adapter projects.
Installation
dotnet add package NOF.Infrastructure
Built-in Capabilities
This package includes:
- in-memory cache (
ICacheService+MemoryCacheServiceRider) - in-memory riders (
MemoryCommandRider,MemoryNotificationRider) - in-process event publisher (
IEventPublisher) - EF Core infrastructure primitives (
NOFDbContext, outbox/inbox entities, tenant-aware model customization,NOFDbContextFactory) - SQLite-based default persistence used by infrastructure defaults
The default in-memory cache implementation is isolated per NOF host:
- cache data lives in
MemoryCacheServiceRiderState - local
GetOrSetAsync(...)locks live inCacheServiceLocalLockState - both are registered as DI singletons instead of process-wide
staticstate
EF Core
Built-in EF Core support is configured through UseDbContext<TDbContext>() and EFCoreSelector:
using Microsoft.EntityFrameworkCore;
using NOF.Infrastructure;
var builder = NOFWebApplicationBuilder.Create(args);
builder.UseDbContext<AppDbContext>()
.WithTenantMode(TenantMode.DatabasePerTenant)
.WithConnectionString(builder.Configuration.GetConnectionString("postgres")
?? throw new InvalidOperationException("Connection string 'postgres' not found."))
.WithOptions(static (optionsBuilder, connectionString) => optionsBuilder.UseNpgsql(connectionString))
.MigrateOnInitialize();
Available configuration methods:
WithTenantMode(...)WithConnectionString(...)WithOptions(...)WithModelCreating(...)MigrateOnInitialize()
SQLite
For SQLite, provide the provider configuration via WithOptions(...):
builder.UseDbContext<AppDbContext>()
.WithTenantMode(TenantMode.SharedDatabase)
.WithConnectionString(builder.Configuration.GetConnectionString("sqlite")
?? throw new InvalidOperationException("Connection string 'sqlite' not found."))
.WithOptions(static (optionsBuilder, connectionString) => optionsBuilder.UseSqlite(connectionString))
.MigrateOnInitialize();
In-Memory SQLite
For tests or lightweight local scenarios, you can use the built-in default SQLite memory configuration that ships with AddInfrastructureDefaults().
If you need a custom app DbContext, configure it explicitly with UseDbContext<TDbContext>().
License
Apache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.EntityFrameworkCore (>= 10.0.0 && < 10.1.0)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.0 && < 10.1.0)
- Microsoft.EntityFrameworkCore.Sqlite (>= 10.0.0 && < 10.1.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0 && < 10.1.0)
- Microsoft.Extensions.Http (>= 10.0.0 && < 10.1.0)
- NOF.Abstraction (>= 10.6.0)
- NOF.Application (>= 10.6.0)
- NOF.Hosting.Abstraction (>= 10.6.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.3 && < 1.16.0)
- OpenTelemetry.Extensions.Hosting (>= 1.15.0 && < 1.16.0)
- OpenTelemetry.Instrumentation.Http (>= 1.15.0 && < 1.16.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.15.0 && < 1.16.0)
NuGet packages (12)
Showing the top 5 NuGet packages that depend on NOF.Infrastructure:
| Package | Downloads |
|---|---|
|
NOF.Test
Testing support for applications built with NOF, including lightweight test hosts, scoped execution helpers, and application-oriented integration testing utilities. |
|
|
NOF.Hosting.AspNetCore
ASP.NET Core hosting for the NOF Framework - OpenAPI service registration, JSON configuration, and CORS. |
|
|
NOF.Infrastructure.StackExchangeRedis
Redis caching infrastructure for the NOF Framework, powered by StackExchange.Redis. |
|
|
NOF.Infrastructure.EntityFrameworkCore
Entity Framework Core persistence integration for the NOF Framework. |
|
|
NOF.Infrastructure.EntityFrameworkCore.PostgreSQL
PostgreSQL provider for the NOF Framework EF Core infrastructure, powered by Npgsql. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-nightly.1356918... | 25 | 7/31/2026 |
| 11.0.0-nightly.1355354... | 46 | 7/30/2026 |
| 11.0.0-nightly.1347238... | 82 | 7/24/2026 |
| 11.0.0-nightly.1344296... | 86 | 7/22/2026 |
| 11.0.0-nightly.1341281... | 80 | 7/20/2026 |
| 11.0.0-nightly.1341256... | 82 | 7/20/2026 |
| 11.0.0-nightly.1338464... | 83 | 7/18/2026 |
| 11.0.0-nightly.1336983... | 87 | 7/17/2026 |
| 11.0.0-nightly.1336667... | 73 | 7/17/2026 |
| 11.0.0-nightly.1334320... | 81 | 7/15/2026 |
| 11.0.0-nightly.1334005... | 92 | 7/15/2026 |
| 11.0.0-nightly.1330994... | 98 | 7/13/2026 |
| 11.0.0-nightly.1327047... | 98 | 7/10/2026 |
| 11.0.0-nightly.1326599... | 91 | 7/10/2026 |
| 11.0.0-nightly.1323601... | 93 | 7/8/2026 |
| 11.0.0-nightly.1322679... | 88 | 7/7/2026 |
| 11.0.0-nightly.1322328... | 83 | 7/7/2026 |
| 11.0.0-nightly.1322306... | 91 | 7/7/2026 |
| 11.0.0-nightly.1321240... | 86 | 7/6/2026 |
| 10.6.0 | 171 | 6/10/2026 |