https://github.com/taberkkaya/repositorykit
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.
https://github.com/taberkkaya/repositorykit
clean-architecture csharp data-access dotnet dotnet9 entity-framework-core linq mongodb nuget open-source repository-pattern unit-testing
Last synced: about 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/taberkkaya/repositorykit
- Owner: taberkkaya
- License: mit
- Created: 2025-05-18T16:08:24.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-06-09T06:38:14.000Z (11 months ago)
- Last Synced: 2025-10-29T01:06:11.386Z (6 months ago)
- Topics: clean-architecture, csharp, data-access, dotnet, dotnet9, entity-framework-core, linq, mongodb, nuget, open-source, repository-pattern, unit-testing
- Language: C#
- Homepage: https://www.nuget.org/packages/RepositoryKit/
- Size: 86.9 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
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`](./src/RepositoryKit.Core) | Provider-agnostic abstractions/interfaces |
| [`RepositoryKit.EntityFramework`](./src/RepositoryKit.EntityFramework) | Entity Framework Core implementation |
| [`RepositoryKit.MongoDb`](./src/RepositoryKit.MongoDb) | MongoDB implementation |
| [`RepositoryKit.Extensions`](./src/RepositoryKit.Extensions) | Useful LINQ/collection extensions |
---
## π Quickstart
### 1. Add a provider package:
```sh
dotnet add package RepositoryKit.EntityFramework
# or
dotnet add package RepositoryKit.MongoDb
```
### **2. Register with DI (EF example):**
```csharp
builder.Services.AddDbContext(...);
builder.Services.AddScoped, EfUnitOfWork>();
builder.Services.AddSingleton();
```
### **3. Use in your app (Minimal API example):**
```csharp
app.MapGet("/products", async (IUnitOfWork uow) =>
{
var repo = uow.GetRepository();
var products = await repo.GetAllAsync();
return Results.Ok(products);
});
```
### **4. Extensions for any collection/repository:**
```csharp
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:
- [Core](https://github.com/taberkkaya/RepositoryKit/blob/master/src/RepositoryKit.Core/README.md)
- [EntityFramework](https://github.com/taberkkaya/RepositoryKit/blob/master/src/RepositoryKit.EntityFramework/README.md)
- [MongoDb](https://github.com/taberkkaya/RepositoryKit/blob/master/src/RepositoryKit.MongoDB/README.md)
- [Extensions](https://github.com/taberkkaya/RepositoryKit/tree/master/src/RepositoryKit.Extensions)
## π€ Contributing
PRs, issues, and suggestions are all welcome!
Feel free to fork, star, or use for your next side project.
## π License
MIT Β© [Ataberk Kaya](https://github.com/taberkkaya)