NOF.Infrastructure
10.5.0
See the version list below for details.
dotnet add package NOF.Infrastructure --version 10.5.0
NuGet\Install-Package NOF.Infrastructure -Version 10.5.0
<PackageReference Include="NOF.Infrastructure" Version="10.5.0" />
<PackageVersion Include="NOF.Infrastructure" Version="10.5.0" />
<PackageReference Include="NOF.Infrastructure" />
paket add NOF.Infrastructure --version 10.5.0
#r "nuget: NOF.Infrastructure, 10.5.0"
#:package NOF.Infrastructure@10.5.0
#addin nuget:?package=NOF.Infrastructure&version=10.5.0
#tool nuget:?package=NOF.Infrastructure&version=10.5.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.5.0)
- NOF.Application (>= 10.5.0)
- NOF.Hosting.Abstraction (>= 10.5.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 (11)
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.EntityFrameworkCore.PostgreSQL
PostgreSQL provider for the NOF Framework EF Core infrastructure, powered by Npgsql. |
|
|
NOF.Infrastructure.EntityFrameworkCore
EF Core infrastructure for the NOF Framework — NOFDbContext, repository pattern, transactional outbox, and multi-tenancy support. |
|
|
NOF.Infrastructure.StackExchangeRedis
Redis caching infrastructure for the NOF Framework, powered by StackExchange.Redis. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.6.0-nightly.1280622.60d7027 | 19 | 6/8/2026 |
| 10.6.0-nightly.1278216.b2a8a6a | 54 | 6/6/2026 |
| 10.6.0-nightly.1278169.115732b | 53 | 6/6/2026 |
| 10.6.0-nightly.1275207.7a22e46 | 67 | 6/4/2026 |
| 10.6.0-nightly.1275187.b146f14 | 65 | 6/4/2026 |
| 10.6.0-nightly.1275143.bbcffd1 | 60 | 6/4/2026 |
| 10.6.0-nightly.1272066.87361d5 | 68 | 6/2/2026 |
| 10.6.0-nightly.1263860.0e25bc5 | 89 | 5/27/2026 |
| 10.6.0-nightly.1261960.84db1f2 | 90 | 5/26/2026 |
| 10.6.0-nightly.1260976.278016a | 85 | 5/25/2026 |
| 10.6.0-nightly.1260949.d6e2270 | 71 | 5/25/2026 |
| 10.6.0-nightly.1260883.04157c7 | 80 | 5/25/2026 |
| 10.6.0-nightly.1255923.6170d7f | 84 | 5/22/2026 |
| 10.6.0-nightly.1254934.8f245f4 | 76 | 5/21/2026 |
| 10.6.0-nightly.1253375.5b42a45 | 76 | 5/20/2026 |
| 10.5.0 | 174 | 5/19/2026 |
| 10.5.0-nightly.1246067.1e768c3 | 78 | 5/15/2026 |
| 10.5.0-nightly.1245792.8d707f7 | 76 | 5/15/2026 |
| 10.5.0-nightly.1245695.d08d98d | 76 | 5/15/2026 |
| 10.5.0-nightly.1244595.ecb70dd | 80 | 5/14/2026 |