UnitOfWorkinator.Abstractions
1.0.1
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
<PackageReference Include="UnitOfWorkinator.Abstractions" Version="1.0.1" />
<PackageVersion Include="UnitOfWorkinator.Abstractions" Version="1.0.1" />
<PackageReference Include="UnitOfWorkinator.Abstractions" />
paket add UnitOfWorkinator.Abstractions --version 1.0.1
#r "nuget: UnitOfWorkinator.Abstractions, 1.0.1"
#:package UnitOfWorkinator.Abstractions@1.0.1
#addin nuget:?package=UnitOfWorkinator.Abstractions&version=1.0.1
#tool nuget:?package=UnitOfWorkinator.Abstractions&version=1.0.1
<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 | Versions 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. |
-
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.