UnitOfWorkinator.Abstractions 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package UnitOfWorkinator.Abstractions --version 1.0.1
                    
NuGet\Install-Package UnitOfWorkinator.Abstractions -Version 1.0.1
                    
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="UnitOfWorkinator.Abstractions" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UnitOfWorkinator.Abstractions" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="UnitOfWorkinator.Abstractions" />
                    
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 UnitOfWorkinator.Abstractions --version 1.0.1
                    
#r "nuget: UnitOfWorkinator.Abstractions, 1.0.1"
                    
#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 UnitOfWorkinator.Abstractions@1.0.1
                    
#: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=UnitOfWorkinator.Abstractions&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=UnitOfWorkinator.Abstractions&version=1.0.1
                    
Install as a Cake Tool

<p align="center"> <img src="assets/logo.png" alt="UnitOfWorkinator logo" width="200"/> </p>

<p align="center"><b>Repositories on autopilot. Unit of Work without the paperwork.</b></p>

What is UnitOfWorkinator?

UnitOfWorkinator is a .NET library that takes the pain out of configuring and managing repositories using the Unit of Work pattern.

Just define your repositories, and it will:

  • Discover and register them automatically
  • Inject the correct DbContext
  • Keep everything clean, testable, and free of boilerplate

Designed for developers who like clean architecture and hate repetitive setup.

Installation

You can install UnitOfWorkinator via NuGet:

Install-Package UnitOfWorkinator

Example Usage

Defining Repositories

With UnitOfWorkinator, you only need to define your repositories. Here's how you can do it:

public interface IProductRepository : BaseRepository, IProductRepository
{
    // Your custom repository methods
}

public interface IOrderRepository : BaseRepository, IOrderRepository
{
    // Your custom repository methods
}

Configuring UnitOfWorkinator

Now, configure UnitOfWorkinator to automatically discover and register your repositories:

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        // Configure your DbContext
        services.AddDbContext<MyDbContext>(options =>
            options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
        
        // Automatically register repositories and de UnitOfWork
        services.AddUnitOfWorkinator<MyDbContext>();
    }
}

Using Repositories

Once everything is set up, you can inject and use your repositories anywhere in your application:

public class MyService
{
    private readonly IProductRepository _productRepository;
    private readonly IOrderRepository _orderRepository;

    public MyService(IProductRepository productRepository, IOrderRepository orderRepository)
    {
        _productRepository = productRepository;
        _orderRepository = orderRepository;
    }

    public void DoSomething()
    {
        // Use your repositories here
        var products = _productRepository.GetAll();
        var orders = _orderRepository.GetAll();
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on UnitOfWorkinator.Abstractions:

Package Downloads
UnitOfWorkinator.EFCore

Repositories on autopilot. Unit of Work without the paperwork.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 142 5/1/2025
1.0.2 144 5/1/2025
1.0.1 144 4/30/2025
1.0.0 203 4/9/2025