Skip to content

Provider-agnostic, modular Repository & UnitOfWork infrastructure for .NET 9+. Easily swap between Entity Framework Core, MongoDB, or custom providers. Clean architecture, fully unit-testable, LINQ-powered, and ready for production.

License

Notifications You must be signed in to change notification settings

taberkkaya/RepositoryKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RepositoryKit logo

RepositoryKit

Provider-agnostic, production-ready Repository & UnitOfWork infrastructure for modern .NET.
Clean. Modular. Mockable.
GitHub β€’ NuGet


🌍 What is RepositoryKit?

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.

πŸ“¦ Packages

Package Description
RepositoryKit.Core Provider-agnostic abstractions/interfaces
RepositoryKit.EntityFramework Entity Framework Core implementation
RepositoryKit.MongoDb MongoDB implementation
RepositoryKit.Extensions Useful LINQ/collection extensions

πŸš€ Quickstart

1. Add a provider package:

dotnet add package RepositoryKit.EntityFramework
# or
dotnet add package RepositoryKit.MongoDb

2. Register with DI (EF example):

builder.Services.AddDbContext<AppDbContext>(...);
builder.Services.AddScoped<IUnitOfWork<AppDbContext>, EfUnitOfWork<AppDbContext>>();
builder.Services.AddSingleton<IUnitOfWorkManager, EfUnitOfWorkManager>();

3. Use in your app (Minimal API example):

app.MapGet("/products", async (IUnitOfWork<AppDbContext> uow) =>
{
    var repo = uow.GetRepository<Product>();
    var products = await repo.GetAllAsync();
    return Results.Ok(products);
});

4. Extensions for any collection/repository:

var distinct = products.SafeDistinct(p => p.CategoryId).ToList();
var firstOrNone = products.AsQueryable().FirstOrNone();

🧩 Why RepositoryKit?

  • 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

πŸ“š Full Documentation

See individual package READMEs for full details:

🀝 Contributing

PRs, issues, and suggestions are all welcome!
Feel free to fork, star, or use for your next side project.

πŸ“œ License

MIT Β© Ataberk Kaya

About

Provider-agnostic, modular Repository & UnitOfWork infrastructure for .NET 9+. Easily swap between Entity Framework Core, MongoDB, or custom providers. Clean architecture, fully unit-testable, LINQ-powered, and ready for production.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages