What is Clean Architecture?
Clean Architecture is a software design philosophy that separates the elements of a design into ring levels. The key rule is that dependencies can only point inward - outer layers can depend on inner layers, but not vice versa.
In .NET, this typically means organizing your solution into layers like Domain, Application, Infrastructure, and Presentation. Each layer has a clear responsibility, and the dependency rule ensures your business logic stays independent of frameworks, databases, and UI concerns.
This guide brings together everything you need to master Clean Architecture in .NET.
Want to go deeper? My Pragmatic Clean Architecture course teaches the complete system I use to ship production-ready applications.
Getting Started
These articles cover the foundational concepts. If you're new to Clean Architecture, start here to understand the "why" before diving into implementation details.
- Clean Architecture and the Benefits of Structured Software Design
- Clean Architecture Folder Structure
- Building Your First Use Case with Clean Architecture
Core Concepts
Once you understand the basics, these articles explore the principles that make Clean Architecture effective in real-world projects - from handling complexity to managing cross-cutting concerns.
- Why Clean Architecture Is Great for Complex Projects
- Clean Architecture: The Missing Chapter
- Balancing Cross-Cutting Concerns in Clean Architecture
- Getting the Current User in Clean Architecture
CQRS and MediatR
The CQRS pattern is a natural complement to Clean Architecture. It separates read and write operations, keeping your use cases focused and testable.
- CQRS Pattern with MediatR
- CQRS Pattern: The Way It Should Have Been From the Start
- Stop Conflating CQRS and MediatR
- CQRS Validation with MediatR Pipeline and FluentValidation
Testing
A well-structured Clean Architecture solution is inherently testable. These guides cover testing strategies at different levels.
- Unit Testing Clean Architecture Use Cases
- Enforcing Software Architecture with Architecture Tests
- 5 Architecture Tests You Should Add to Your .NET Projects
Domain-Driven Design
Clean Architecture provides the structure, and DDD provides the modeling techniques. These articles cover the DDD fundamentals you'll use inside the Domain layer.
- Value Objects in .NET: DDD Fundamentals
- How to Use Domain Events to Build Loosely Coupled Systems
- Refactoring From an Anemic Domain Model to a Rich Domain Model
- From Transaction Scripts to Domain Models: A Refactoring Journey
Related Architectures
Clean Architecture isn't the only option. These complementary approaches can be used alongside it or as alternatives depending on your project's needs.