hrynco-ef
Reusable Entity Framework Core base library for HrynCo applications.
Solution
The solution (hrynco-ef.slnx) contains two projects:
| Project |
Description |
HrynCo.DAL.Abstract |
Infrastructure-agnostic contracts: entities, repository interfaces, unit of work, transactions, pagination. No EF Core dependency. |
HrynCo.DAL.EF |
Entity Framework Core implementations of the abstract contracts. Depends on HrynCo.DAL.Abstract and EF Core. |
The split allows consuming projects to reference only HrynCo.DAL.Abstract in domain/application layers, keeping those layers free of EF Core.
Packages
HrynCo.DAL.Abstract
| Type |
Description |
IEntity / IEntity<TId> |
Base entity contracts |
Entity<TId> / Entity |
Base entity implementations with auto-generated Id |
NamedEntity |
Entity with a Name property |
IUnitOfWork |
Unit of work interface with transaction support |
ITransaction |
Async transaction contract |
PagedResult<T> |
Pagination result wrapper |
HrynCo.DAL.EF
| Type |
Description |
BaseRepository<T> |
Base repository wrapping the EF repository (lazy) |
BaseEfRepository<T> |
EF Core repository with full CRUD and DbContext access |
IEfRepository<T> |
EF-specific repository interface |
EfUnitOfWork |
EF Core unit of work implementation |
EfTransactionAdapter |
Adapts EF transactions to ITransaction |
Usage
Reference HrynCo.DAL.Abstract for contracts only (domain/application layers).
Reference HrynCo.DAL.EF for the full EF Core implementation (infrastructure layer).
Pages
Related
- IT-642 — Extract
PagedResult builder as reusable IQueryable<T> extension