# renzojared/dotemilu architecture

> Architecture diagram of the GitHub repository renzojared/dotemilu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/renzojared/dotemilu
- Repository: https://github.com/renzojared/dotemilu

## Overview

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: [`src/DotEmilu.EntityFrameworkCore`](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.EntityFrameworkCore) (EntityFrameworkCore), [`src/DotEmilu`](https://github.com/renzojared/dotemilu/tree/main/src/DotEmilu) (Core), [`src/DotEmilu.AspNetCore`](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.AspNetCore) (AspNetCore), [`src/DotEmilu.Abstractions`](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.Abstractions) (Abstractions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Core packages"]
  node_n1["Abstractions<br/>contracts package"]
  node_n2["Core<br/>use-case pipeline"]
  node_n3["Verifier<br/>validation stage<br/>[Verifier.cs]"]
  node_n4["Handler<br/>[Handler.cs]"]
  node_n5["ChainHandler<br/>orchestration<br/>[ChainHandler.cs]"]
  node_n6["AspNetCore<br/>http adapter"]
  node_n7["HttpHandler<br/>endpoint bridge<br/>[HttpHandler.cs]"]
  node_n8["Presenter<br/>response mapper<br/>[Presenter.cs]"]
  node_n9["EntityFrameworkCore<br/>persistence adapter"]
  node_n10["Interceptors<br/>write policies"]
  node_n11["Mappings<br/>model config"]
  node_n12["Queries<br/>read helpers<br/>[QueryExtensions.cs]"]
end

subgraph group_g2["Samples"]
  node_n13["Console sample<br/>runtime sample"]
  node_n14["EF sample<br/>runtime sample"]
  node_n15["Full app<br/>end-to-end sample"]
  node_n16["Features<br/>use-case modules<br/>[Features]"]
  node_n17["Infrastructure<br/>[Infrastructure]"]
  node_n18["Workers<br/>background jobs<br/>[Workers]"]
end

subgraph group_g3["Tests"]
  node_n19["Unit tests<br/>test suite<br/>[DotEmilu.UnitTests]"]
  node_n20["Integration tests<br/>integration suite"]
end

subgraph group_g4["Repository root"]
  node_n21["Solution<br/>repo root<br/>[DotEmilu.slnx]"]
end

node_n2 -->|"depends on"| node_n1
node_n3 -->|"implements"| node_n1
node_n4 -->|"implements"| node_n1
node_n5 -->|"extends"| node_n4
node_n5 -->|"uses"| node_n3
node_n6 -->|"depends on"| node_n2
node_n7 -->|"part of"| node_n6
node_n8 -->|"part of"| node_n6
node_n9 -->|"depends on"| node_n1
node_n10 -->|"part of"| node_n9
node_n11 -->|"part of"| node_n9
node_n12 -->|"part of"| node_n9
node_n13 -->|"uses"| node_n2
node_n14 -->|"uses"| node_n9
node_n15 -->|"uses"| node_n6
node_n15 -->|"uses"| node_n9
node_n16 -->|"uses"| node_n2
node_n17 -->|"uses"| node_n9
node_n18 -->|"uses"| node_n2
node_n19 -->|"verifies"| node_n2
node_n19 -->|"verifies"| node_n6
node_n20 -->|"verifies"| node_n9
node_n20 -->|"verifies"| node_n15
node_n21 -->|"organizes"| node_n1
node_n21 -->|"organizes"| node_n2
node_n21 -->|"organizes"| node_n6
node_n21 -->|"organizes"| node_n9

click node_n1 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.Abstractions"
click node_n2 "https://github.com/renzojared/dotemilu/tree/main/src/DotEmilu"
click node_n3 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu/Verifier.cs"
click node_n4 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu/Handler.cs"
click node_n5 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu/ChainHandler.cs"
click node_n6 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.AspNetCore"
click node_n7 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.AspNetCore/HttpHandler.cs"
click node_n8 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.AspNetCore/Presenter.cs"
click node_n9 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.EntityFrameworkCore"
click node_n10 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.EntityFrameworkCore/AuditableEntityInterceptor.cs"
click node_n11 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.EntityFrameworkCore/BaseEntityConfiguration.cs"
click node_n12 "https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.EntityFrameworkCore/Extensions/QueryExtensions.cs"
click node_n13 "https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.ConsoleApp"
click node_n14 "https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.EntityFrameworkCore"
click node_n15 "https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.FullApp"
click node_n16 "https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.FullApp/Features"
click node_n17 "https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.FullApp/Infrastructure"
click node_n18 "https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.FullApp/Workers"
click node_n19 "https://github.com/renzojared/dotemilu/blob/main/tests/DotEmilu.UnitTests"
click node_n20 "https://github.com/renzojared/dotemilu/blob/main/tests/DotEmilu.IntegrationTests"
click node_n21 "https://github.com/renzojared/dotemilu/blob/main/DotEmilu.slnx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_n1,node_n2,node_n3,node_n4,node_n5,node_n6,node_n7,node_n8,node_n9,node_n10,node_n11,node_n12 toneBlue
class node_n13,node_n14,node_n15,node_n16,node_n17,node_n18 toneAmber
class node_n19,node_n20 toneMint
class node_n21 toneRose
```

## Components

### Core packages

Shared contracts, pipeline, and adapters

- [Abstractions](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.Abstractions): contracts package · Shared request, handler, verifier, entity, and pagination contracts · `src/DotEmilu.Abstractions`
- [Core](https://github.com/renzojared/dotemilu/tree/main/src/DotEmilu): use-case pipeline · Validation-first handler runtime for application use cases · `src/DotEmilu`
- [Verifier](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu/Verifier.cs): validation stage · Runs request verification before handler execution · `src/DotEmilu/Verifier.cs`
- [Handler](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu/Handler.cs): request handler · Typed request/response handler base execution model · `src/DotEmilu/Handler.cs`
- [ChainHandler](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu/ChainHandler.cs): orchestration · Coordinates multi-step use cases and chained workflows · `src/DotEmilu/ChainHandler.cs`
- [AspNetCore](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.AspNetCore): http adapter · Minimal API bridge for handlers and presenters · `src/DotEmilu.AspNetCore`
- [HttpHandler](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.AspNetCore/HttpHandler.cs): endpoint bridge · Adapts HTTP requests into the handler pipeline · `src/DotEmilu.AspNetCore/HttpHandler.cs`
- [Presenter](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.AspNetCore/Presenter.cs): response mapper · Formats success and error responses, including Problem Details · `src/DotEmilu.AspNetCore/Presenter.cs`
- [EntityFrameworkCore](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.EntityFrameworkCore): persistence adapter · EF Core integration for interceptors, mappings, and query helpers · `src/DotEmilu.EntityFrameworkCore`
- [Interceptors](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.EntityFrameworkCore/AuditableEntityInterceptor.cs): write policies · Auditing and soft-delete behavior applied during persistence · `src/DotEmilu.EntityFrameworkCore/AuditableEntityInterceptor.cs`
- [Mappings](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.EntityFrameworkCore/BaseEntityConfiguration.cs): model config · Base entity configuration and model-building extensions · `src/DotEmilu.EntityFrameworkCore/BaseEntityConfiguration.cs`
- [Queries](https://github.com/renzojared/dotemilu/blob/main/src/DotEmilu.EntityFrameworkCore/Extensions/QueryExtensions.cs): read helpers · CQRS-oriented query, pagination, and unit-of-work support · `src/DotEmilu.EntityFrameworkCore/Extensions/QueryExtensions.cs`

### Samples

Runnable examples of the layered architecture

- [Console sample](https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.ConsoleApp): runtime sample · Handler-only scenarios without web or database infrastructure · `samples/DotEmilu.Samples.ConsoleApp`
- [EF sample](https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.EntityFrameworkCore): runtime sample · EF Core-specific scenarios and persistence behavior · `samples/DotEmilu.Samples.EntityFrameworkCore`
- [Full app](https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.FullApp): end-to-end sample · Minimal API, handlers, validators, EF Core, and workers together · `samples/DotEmilu.Samples.FullApp`
- [Features](https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.FullApp/Features): use-case modules · Feature folders containing requests, handlers, validators, and endpoints · `samples/DotEmilu.Samples.FullApp/Features`
- [Infrastructure](https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.FullApp/Infrastructure): app infrastructure · Auth, persistence, and configuration for the full sample · `samples/DotEmilu.Samples.FullApp/Infrastructure`
- [Workers](https://github.com/renzojared/dotemilu/blob/main/samples/DotEmilu.Samples.FullApp/Workers): background jobs · Background processing that complements the HTTP-driven sample · `samples/DotEmilu.Samples.FullApp/Workers`

### Tests

Unit and integration coverage

- [Unit tests](https://github.com/renzojared/dotemilu/blob/main/tests/DotEmilu.UnitTests): test suite · Covers core behaviors, adapters, and DI registration · `tests/DotEmilu.UnitTests`
- [Integration tests](https://github.com/renzojared/dotemilu/blob/main/tests/DotEmilu.IntegrationTests): integration suite · Validates EF Core behavior and full ASP.NET Core endpoints · `tests/DotEmilu.IntegrationTests`

### Repository root

Solution and build orchestration

- [Solution](https://github.com/renzojared/dotemilu/blob/main/DotEmilu.slnx): repo root · Multi-project solution and central build/package management · `DotEmilu.slnx`

## Connections

- 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
