.Net project structure and dependency flow
Our standard approach is to follow a clean architecture approach with clear separation of the layers and dependencies only flowing in one direction (towards the domain). In larger systems, this may be added to by splitting by aggregate root into modules.
Sample Visual Studio project structure
- solution items
- readme.md
- src
- API
- Application
- Domain
- Infrastructure
- Shared (Optional, can also be called Core)
- tests
- API.Tests
- Application.Tests
- Domain.Tests
- Infrastructure.Tests
- Shared.Tests
- Architecture.Tests
Note: the folders: solution items, src and tests should be added as solution folders within Visual Studio irrespective of whether they have those folders in the file system.
Project dependency flow
