Clean Architecture
The dependency rule, and where each pattern above actually lives.
Concentric layers — Domain (entities, value objects, domain logic — zero external dependencies) at the center, Application (use cases/handlers, orchestration — depends only on Domain) around it, then Infrastructure (EF Core, message bus clients, external APIs) and Presentation (API controllers/Minimal API endpoints) on the outside.
The Dependency Rule: source code dependencies point inward only. Infrastructure depends on
Application/Domain abstractions (via interfaces defined in the inner layers), never the reverse —
this is Dependency Inversion applied project-wide, not just per-class. In practice: your
IOrderRepository interface lives in Domain/Application; EfOrderRepository (the implementation)
lives in Infrastructure and is wired up via DI at the composition root (Program.cs).
Where the topics above physically live: Repository interfaces + Strategy interfaces + domain entities → Domain/Application. Repository/Strategy implementations, DbContext, NServiceBus/RabbitMQ client config → Infrastructure. MediatR handlers (Commands/Queries) → Application. This mapping is a great answer if asked "where would you put X" for anything in this whole document.