ardalis /CleanArchitecture
Clean Architecture Solution Template: A proven Clean Architecture Template for ASP.NET Core 10
★ 18,550⑂ 3,144👁 400⑃ 918● 253▤ 16
-1
日增长
18,550
stars
3,144
forks
400
watchers
918
prs
253
issues
16
releases
README
Clean Architecture dotnet new templates for building ASP.NET Core applications with Clean Architecture, also known as hexagonal, ports-and-adapters, or onion architecture. The domain model sits at the center, and dependencies point inward toward it. There are two templates: - Full Clean Architecture (clean-arch): a multi-project solution (Core, UseCases, Infrastructure, Web) with DDD patterns, CQRS via Mediator, and FastEndpoints. Best for larger, long-lived applications. - Minimal Clean Architecture (min-clean): a single project organized by vertical slices, with layer boundaries enforced by NsDepCop. Best for MVPs and smaller applications. A complete sample application lives in /sample. Getting Started Install the templates from NuGet: powershell dotnet new install Ardalis.CleanArchitecture.Template dotnet new install Ardalis.MinimalClean.Template Create a solution from either template: powershell Full Clean Architecture dotnet new clean-arch -o Your.ProjectName Minimal Clean Architecture dotnet new min-clean -o Your.ProjectName Documentation Everything else is in the docs: cleanarchitecture.ardalis.com. That includes getting started, choosing between the templates, design decisions, dependency rules, and migration guides for upgrading from earlier versions. Learn More - Introducing Clean Architecture course from NimblePros (use code ARDALIS to save 20%) - NimblePros offers Clean Architecture and DDD training and implementation help for teams If this project helps you, please give it a star :star:. You can also support it through GitHub Sponsors.
Discussions
#1053Should ContributorName use string.IsNullOrWhiteSpace() instead of string.IsNullOrEmpty()?1 comments · 2026-06-11#1013Asserting EF Core query counts in integration tests — catching N+1 regressions0 comments · 2026-04-17#965Query models vs entity models0 comments · 2025-09-20#963I'm struggling with the concept of repositories for queries0 comments · 2025-08-22#961Can an entity make use of dependency injection1 comments · 2025-08-08#960Why aren't there any factories?1 comments · 2025-08-08#959Default constructors required for EF1 comments · 2025-08-08#954Cannot build template via .sln or .slnx3 comments · 2025-07-15
Latest release
v12.0.1 v12.0.1 2026-11-13A patch release that fixes the README generated by clean-arch. Both templates move to 12.0.1 so they keep sharing a version number.
| Package | Previous | New |
|---|---|---|
| Ardalis.CleanArchitecture.Template (clean-arch) | 12.0.0 | 12.0.1 |
| Ardalis.MinimalClean.Template (min-clean) | 12.0.0 | 12.0.1 (no template changes) |
bash
dotnet new update
Fixes
- The generated README.md now starts with your solution's name instead of a literal ${name}, and its commands use your project names instead of Your.ProjectName. For example, dotnet new clean-arch -o Acme-Orders gets dotnet run --proj