How renzojared/dotemilu works
1. This repository is a .NET 10 library ecosystem for “use-case-driven” applications. It is not a single app; it is four NuGet-packaged layers plus runnable samples and tests. The core architectural idea is: request contracts flow into typed handlers, validators run first, then use-case logic executes, with optional chaining/orchestration and optional HTTP or EF Core integration.
2. DotEmilu.Abstractions is the lowest-level boundary. It contains the shared contracts and base types used everywhere else: IRequest, IHandler, IVerifier, IContextUser, BaseEntity, BaseAuditableEntity, and PaginatedList. This package is intentionally standalone so the rest of the ecosystem depends upward from it.
3. DotEmilu is the core application pipeline. It provides the handler abstractions and runtime pipeline for request handling, including validation-first behavior via Verifier<T>, request handlers for commands/queries, and chain/orchestrating handler patterns. This is where the “application use case” execution model lives.
4. The main data flow in the core package is: a request object enters a handler, the verifier resolves and executes validation, then the concrete handler runs the use-case logic. For composite workflows, ChainHandler<TChain> and related orchestration patterns let one use case coordinate multiple steps while keeping each step isolated.
5. DotEmilu.AspNetCore is the HTTP boundary adapter. It bridges Minimal API endpoints to the handler pipeline through HttpHandler, AsDelegate, and IPresenter. It also standardizes success/error responses, including RFC 7807 Problem Details, so HTTP concerns stay outside the core use-case handlers.
6. DotEmilu.EntityFrameworkCore is the persistence boundary adapter. It adds EF Core-specific building blocks such as auditable entity interception, soft delete interception, base entity configurations, mapping strategies, query/pagination helpers, and a IUnitOfWork abstraction. It also includes CQRS-oriented interfaces and contexts for separating command/query access patterns.
7. The EF Core execution path is: application handlers depend on CQRS-style persistence interfaces, the EF Core implementation provides DbContext-backed storage, interceptors enrich or transform writes, and query helpers support projection and pagination. This keeps persistence rules centralized rather than embedded in each feature handler.
8. The samples directory shows how the layers compose in different runtime styles. DotEmilu.Samples.ConsoleApp demonstrates handler patterns without web or database infrastructure. DotEmilu.Samples.EntityFrameworkCore demonstrates EF Core-specific behavior in isolation. DotEmilu.Samples.FullApp is the end-to-end reference app that combines Minimal API, handlers, validators, EF Core, background worker logic, and feature-based organization.
9. In the full app sample, the architecture is feature-oriented: each use case has its own folder with request/handler/validator code, while infrastructure is separated into DiContainers, Infrastructure, and Workers. This makes the sample a good diagram reference for how requests move from API endpoint to feature handler to persistence and back to the client.
10. The repository’s test strategy is split between unit and integration tests. Unit tests validate the core handler behaviors, verifier behavior, DI registration, presenter/HTTP adapter behavior, and pagination utilities. Integration tests validate EF Core interceptors, query/model extensions, and the full ASP.NET Core sample endpoints end-to-end.
11. The repo is organized as a multi-project solution with central package/version management and lock files. That matters architecturally because the packages are designed to be consumed independently, but they are also layered in a dependency chain: abstractions first, then core, then optional ASP.NET Core and EF Core adapters.
12. For an architecture diagram, the important boundaries are: request contracts and entities in shared/domain-style projects; handler pipeline in the core package; HTTP entry points in the ASP.NET Core adapter; database and interception behavior in the EF Core adapter; and samples/tests as consumers that prove the boundaries hold. The overall shape is a clean layered architecture with a use-case-centered application core.
Main entry points: DotEmilu.EntityFrameworkCore EntityFrameworkCore · DotEmilu Core · DotEmilu.AspNetCore AspNetCore · DotEmilu.Abstractions Abstractions
Components 21
Core packages
Shared contracts, pipeline, and adapters
- Abstractions · Shared request, handler, verifier, entity, and pagination contracts
src/DotEmilu.Abstractions - Core · Validation-first handler runtime for application use cases
src/DotEmilu - Verifier · Runs request verification before handler execution
src/DotEmilu/Verifier.cs - Handler · Typed request/response handler base execution model
src/DotEmilu/Handler.cs - ChainHandler · Coordinates multi-step use cases and chained workflows
src/DotEmilu/ChainHandler.cs - AspNetCore · Minimal API bridge for handlers and presenters
src/DotEmilu.AspNetCore - HttpHandler · Adapts HTTP requests into the handler pipeline
src/DotEmilu.AspNetCore/HttpHandler.cs - Presenter · Formats success and error responses, including Problem Details
src/DotEmilu.AspNetCore/Presenter.cs - EntityFrameworkCore · EF Core integration for interceptors, mappings, and query helpers
src/DotEmilu.EntityFrameworkCore - Interceptors · Auditing and soft-delete behavior applied during persistence
src/DotEmilu.EntityFrameworkCore/AuditableEntityInterceptor.cs - Mappings · Base entity configuration and model-building extensions
src/DotEmilu.EntityFrameworkCore/BaseEntityConfiguration.cs - Queries · CQRS-oriented query, pagination, and unit-of-work support
src/DotEmilu.EntityFrameworkCore/Extensions/QueryExtensions.cs
Samples
Runnable examples of the layered architecture
- Console sample · Handler-only scenarios without web or database infrastructure
samples/DotEmilu.Samples.ConsoleApp - EF sample · EF Core-specific scenarios and persistence behavior
samples/DotEmilu.Samples.EntityFrameworkCore - Full app · Minimal API, handlers, validators, EF Core, and workers together
samples/DotEmilu.Samples.FullApp - Features · Feature folders containing requests, handlers, validators, and endpoints
samples/DotEmilu.Samples.FullApp/Features - Infrastructure · Auth, persistence, and configuration for the full sample
samples/DotEmilu.Samples.FullApp/Infrastructure - Workers · Background processing that complements the HTTP-driven sample
samples/DotEmilu.Samples.FullApp/Workers
Tests
Unit and integration coverage
- Unit tests · Covers core behaviors, adapters, and DI registration
tests/DotEmilu.UnitTests - Integration tests · Validates EF Core behavior and full ASP.NET Core endpoints
tests/DotEmilu.IntegrationTests
Repository root
Solution and build orchestration
- Solution · Multi-project solution and central build/package management
DotEmilu.slnx
Connections 27
- Core → Abstractions: depends on · Core execution pipeline is built on shared contracts
- Verifier → Abstractions: implements · Verifier works against shared request and verifier contracts
- Handler → Abstractions: implements · Handler base types implement the shared handler contract
- ChainHandler → Handler: extends · Chain/orchestration builds on the handler runtime
- ChainHandler → Verifier: uses · Chained workflows still validate before each step
- AspNetCore → Core: depends on · HTTP adapter forwards execution into the core pipeline
- HttpHandler → AspNetCore: part of · HttpHandler is the main bridge into Minimal API endpoints
- Presenter → AspNetCore: part of · Presenter standardizes HTTP responses for the adapter
- EntityFrameworkCore → Abstractions: depends on · EF Core adapter uses shared entities and context user contracts
- Interceptors → EntityFrameworkCore: part of · Interceptors are persistence behavior within the EF Core adapter
- Mappings → EntityFrameworkCore: part of · Mapping/configuration helpers live inside the EF Core adapter
- Queries → EntityFrameworkCore: part of · Query helpers and unit-of-work abstractions belong to persistence
- Console sample → Core: uses · Console scenarios exercise the core handler pipeline
- EF sample → EntityFrameworkCore: uses · EF sample demonstrates the persistence adapter in isolation
- Full app → AspNetCore: uses · Full app exposes features through HTTP endpoints
- Full app → EntityFrameworkCore: uses · Full app persists data through EF Core integration
- Features → Core: uses · Feature modules are centered on request/handler execution
- Infrastructure → EntityFrameworkCore: uses · Infrastructure provides the EF-backed persistence boundary
- Workers → Core: uses · Workers reuse the same use-case pipeline patterns
- Unit tests → Core: verifies · Unit tests cover core handlers, verifier, and DI behavior
- Unit tests → AspNetCore: verifies · Unit tests cover HTTP handler and presenter behavior
- Integration tests → EntityFrameworkCore: verifies · Integration tests cover interceptors and query/model extensions
- Integration tests → Full app: verifies · Integration tests exercise the full sample endpoints end to end
- Solution → Abstractions: organizes · Solution ties together the layered packages and samples
- Solution → Core: organizes · Solution ties together the layered packages and samples
- Solution → AspNetCore: organizes · Solution ties together the layered packages and samples
- Solution → EntityFrameworkCore: organizes · Solution ties together the layered packages and samples