NPv.Uow.Abstractions
1.0.0
dotnet add package NPv.Uow.Abstractions --version 1.0.0
NuGet\Install-Package NPv.Uow.Abstractions -Version 1.0.0
<PackageReference Include="NPv.Uow.Abstractions" Version="1.0.0" />
<PackageVersion Include="NPv.Uow.Abstractions" Version="1.0.0" />
<PackageReference Include="NPv.Uow.Abstractions" />
paket add NPv.Uow.Abstractions --version 1.0.0
#r "nuget: NPv.Uow.Abstractions, 1.0.0"
#:package NPv.Uow.Abstractions@1.0.0
#addin nuget:?package=NPv.Uow.Abstractions&version=1.0.0
#tool nuget:?package=NPv.Uow.Abstractions&version=1.0.0
NPv.Uow.Abstractions
Lightweight, transport-agnostic Unit of Work contract for .NET.
Designed to keep transaction concerns independent from CQS or Messaging layers.
✨ Provided Interfaces
Interface | Purpose |
---|---|
IUnitOfWork |
Coordinates a transactional boundary and supports async disposal |
namespace NPv.Uow.Abstractions;
public interface IUnitOfWork : IAsyncDisposable
{
Task CommitAsync();
}
🔧 When to use
- Wrap execution of root commands or application services in a single transactional scope
- Keep persistence concerns separate from web transport (no HTTP middleware required)
- Enable Outbox or other post-commit hooks in concrete implementations without coupling contracts to a messaging library
🚀 Quick start (usage pattern)
public class UnitOfWorkCommandExecutor(
ICommandBuilder commands, // from your CQS layer
IUnitOfWork uow) // from NPv.Uow.Abstractions
{
public async Task ExecuteAsync<TContext>(TContext ctx)
where TContext : ICommandContext
{
await using (uow)
{
await commands.ExecuteAsync(ctx);
await uow.CommitAsync();
}
}
}
The interface is intentionally tiny so different implementations (EF Core, Dapper + manual tx, etc.) can plug in without leaking details.
📦 NuGet
dotnet add package NPv.Uow.Abstractions
🧩 Related Implementations
NPv.Uow.Ef
— EF Core–based Unit of Work that commits a DbContext and can trigger Outbox publication after commit.
Author's Note
This library grew out of my long-standing personal interest in structuring and publishing open source packages. Over time, I’ve revisited and refined earlier internal utilities and ideas, giving them a more consistent shape and preparing them for wider reuse. Along the way, I’ve also taken the opportunity to explore how open source distribution and licensing work in the .NET ecosystem.
It’s a small step toward something I’ve always wanted to try — sharing practical, minimal tools that reflect years of learning, experimentation, and refinement.
Hopefully, someone finds it useful.
Nikolai 😛
⚖️ License
MIT — free for commercial and open-source use.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NPv.Uow.Abstractions:
Package | Downloads |
---|---|
NPv.CQS.Infrastructure
Provides command and query execution infrastructure for CQS-based applications, with builder implementations and Autofac support. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 147 | 8/10/2025 |