In Martin Fowler’s PoEAA, the Repository pattern is described as:
Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.
This collection of packages focuses on formalizing data access abstractions and offers some unambitious implementations. This packages are designed with respect to clean architecture and evented domain centric applications, although they add value even if your model is rather crud.
The package NBB.Data.Abstractions contains some very lightweight abstractions over data repositories:
- CRUD repository
- Event sourced repository
- Read-only repository
- Unit of work repository
For more details see NBB.Data.Abstractions
The package NBB.Data.EntityFramework provides some implementations for abstractions formalized above using Entity Framework:
EfCrudRepository
EfReadOnlyRepository
EfUow
- unit of work implementationEfQuery
- implementation ofIQueryable<TEntity>
andIAsyncEnumerable<TEntity>
For more details see NBB.Data.EntityFramework
The package NBB.Data.EntityFramework.MultiTenancy helps implementing a multi-tenant data access solution using Entity Framework
For more details see NBB.Data.EntityFramework.MultiTenancy
This package aims to help you deal with data access when working with event sourced domain models.
It offers an EventSourcedRepository
that:
- reads/persists events from/into an
IEventStore
- manages snapshots using an
ISnapshotStore
- dispatches events using
MediatR
For more details see NBB.Data.EventSourcing