NOF.Infrastructure 10.6.0

There is a newer prerelease version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NOF.Infrastructure" Version="10.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NOF.Infrastructure" Version="10.6.0" />
                    
Directory.Packages.props
<PackageReference Include="NOF.Infrastructure" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NOF.Infrastructure --version 10.6.0
                    
#r "nuget: NOF.Infrastructure, 10.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NOF.Infrastructure@10.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NOF.Infrastructure&version=10.6.0
                    
Install as a Cake Addin
#tool nuget:?package=NOF.Infrastructure&version=10.6.0
                    
Install as a Cake Tool

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 NOFDbContext support
  • builder-scoped TypeResolver
  • ambient IMapper / IIdGenerator activation through scoped IDaemonService

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 in CacheServiceLocalLockState
  • both are registered as DI singletons instead of process-wide static state

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed