
Provider-agnostic, production-ready Repository & UnitOfWork infrastructure for modern .NET.
Clean. Modular. Mockable.
GitHub β’
NuGet
RepositoryKit is a modular, unified infrastructure for .NET projects
that provides a clean and extensible Repository & UnitOfWork abstraction.
- EF Core, MongoDB and more: Swap your database backend with zero changes to your business logic.
- Mockable & testable: Designed from scratch for modern dependency injection and testing.
- Plug & play: Use only what you needβeach provider is its own NuGet package.
Package | Description |
---|---|
RepositoryKit.Core |
Provider-agnostic abstractions/interfaces |
RepositoryKit.EntityFramework |
Entity Framework Core implementation |
RepositoryKit.MongoDb |
MongoDB implementation |
RepositoryKit.Extensions |
Useful LINQ/collection extensions |
dotnet add package RepositoryKit.EntityFramework
# or
dotnet add package RepositoryKit.MongoDb
builder.Services.AddDbContext<AppDbContext>(...);
builder.Services.AddScoped<IUnitOfWork<AppDbContext>, EfUnitOfWork<AppDbContext>>();
builder.Services.AddSingleton<IUnitOfWorkManager, EfUnitOfWorkManager>();
app.MapGet("/products", async (IUnitOfWork<AppDbContext> uow) =>
{
var repo = uow.GetRepository<Product>();
var products = await repo.GetAllAsync();
return Results.Ok(products);
});
var distinct = products.SafeDistinct(p => p.CategoryId).ToList();
var firstOrNone = products.AsQueryable().FirstOrNone();
- Provider-agnostic: No more vendor lock-in
- Test-friendly: Mock everything, everywhere
- Production patterns: Real-world repository & UoW
- Minimal boilerplate: Focus on your business logic
See individual package READMEs for full details:
PRs, issues, and suggestions are all welcome!
Feel free to fork, star, or use for your next side project.
MIT Β© Ataberk Kaya