Uniform.Foundations 1.0.41-preview

This is a prerelease version of Uniform.Foundations.
dotnet add package Uniform.Foundations --version 1.0.41-preview
                    
NuGet\Install-Package Uniform.Foundations -Version 1.0.41-preview
                    
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="Uniform.Foundations" Version="1.0.41-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Uniform.Foundations" Version="1.0.41-preview" />
                    
Directory.Packages.props
<PackageReference Include="Uniform.Foundations" />
                    
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 Uniform.Foundations --version 1.0.41-preview
                    
#r "nuget: Uniform.Foundations, 1.0.41-preview"
                    
#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 Uniform.Foundations@1.0.41-preview
                    
#: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=Uniform.Foundations&version=1.0.41-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Uniform.Foundations&version=1.0.41-preview&prerelease
                    
Install as a Cake Tool

Uniform.Foundations

Core abstractions for the Uniform microservice framework. This package is pulled in automatically as a dependency of Uniform — you only need to reference it directly when building a Uniform module or provider.

What's included

Namespace Purpose
Uniform.Foundations IUniformModule — the plugin interface all modules implement
Uniform.Foundations.Configuration ISettings — cached, TTL-backed config access
Uniform.Foundations.Runtime IEnvironment, IStartupHook, IWebContextAccessor
Uniform.Foundations.Data UniformDatabaseContext, IQuery<T>, IDatabaseContext
Uniform.Foundations.Middleware IMiddleware — before/after/error pipeline hooks
Uniform.Foundations.BackgroundServices IRecurringBackgroundService
Uniform.Foundations.Messaging IMetadataService, HandleContextMetadata
Uniform.Foundations.Outbox IOutbox<T> — transactional outbox support

IUniformModule

Every Uniform module implements this interface to register its own services:

public class MyModule : IUniformModule
{
    public void RegisterServices(IServiceCollection services)
    {
        services.AddScoped<IMyService, MyService>();
    }
}

ISettings

Scoped, cached access to configuration with a 300-second TTL:

public class MyConsumer(ISettings settings)
{
    public Task Consume(MyMessage message)
    {
        var apiKey = settings["MyService:ApiKey"];
    }
}

IQuery<T>

Encapsulates a database query as a typed object. Keeps query logic out of controllers and consumers:

public class ActiveUsersByOrgQuery(Guid orgId) : IQuery<User>
{
    public IQueryable<User> Filter(IQueryable<User> query)
        => query.Where(u => u.OrganisationId == orgId && u.IsActive);
}

// Usage via IDatabaseContext:
var users = await _db.Query(new ActiveUsersByOrgQuery(orgId)).ToListAsync();

UniformDatabaseContext

Base class for your EF Core DbContext that implements IDatabaseContext:

public class MyDbContext : UniformDatabaseContext
{
    public MyDbContext(DbContextOptions<MyDbContext> options) : base(options) { }

    public DbSet<User> Users => Set<User>();
}

IRecurringBackgroundService

Runs a task on a fixed interval. Register it with .AddBackgroundService<T>() on your UniformService:

public class HeartbeatService : IRecurringBackgroundService
{
    public int IntervalMs => 60_000; // every 60 seconds

    public async Task ExecuteAsync()
    {
        // runs every minute
    }
}

IStartupHook

Executes once on service startup, before the host begins processing messages:

public class MigrateOnStartup(MyDbContext db) : IStartupHook
{
    public async Task OnStartup()
    {
        await db.Database.MigrateAsync();
    }
}

Register it in your module:

services.AddScoped<IStartupHook, MigrateOnStartup>();

IMiddleware

Cross-cutting Before/After/Error hooks that wrap every message handler:

public class MyMiddleware : IMiddleware
{
    public Task Before(IHandleContextMetadata metadata, object message) { ... }
    public Task After(IHandleContextMetadata metadata, object message)  { ... }
    public Task Error(Exception ex, IHandleContextMetadata metadata, object message) { ... }
}
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 Uniform.Foundations:

Package Downloads
Uniform.Messaging

Messaging abstractions for the Uniform framework: IPublisher, IConsumer, HandleContext, and publish options.

Uniform.Messaging.RabbitMq

RabbitMQ messaging provider for the Uniform microservice framework.

Uniform.Logging.Seq

Seq structured logging module for the Uniform microservice framework.

Uniform.Web

ASP.NET Core integration module for the Uniform microservice framework.

Uniform.SDK

Host bootstrapping, background services, and consumer discovery for the Uniform microservice framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.41-preview 80 9/11/2026
1.0.40-preview 118 7/21/2026
1.0.39-preview 86 6/28/2026
1.0.38-preview 90 6/26/2026
1.0.37-preview 88 6/6/2026
1.0.36-preview 79 5/25/2026
1.0.35-preview 87 5/18/2026
1.0.34-preview 86 5/10/2026
1.0.33-preview 88 5/9/2026
1.0.32-preview 91 5/8/2026
1.0.31-preview 84 5/8/2026
1.0.30-preview 369 5/8/2026