This is a solution template for creating a backend framework following the principles of Clean Architecture. Create a new project based on this template by clicking the above Use this template button or download the solution.
What is CQRS
- .NET 5
- Entity Framework Core 5
- MediatR
- AutoMapper
- FluentValidation
- NUnit, FluentAssertions, Moq
- Install the latest .NET 5 SDK
Create a folder for your solution and copy the clean code solution into it.
Run RenameSolution.ps1 on the new solution folder to rename it to your project.
This will contain all unit tests.
This will contain all entities, enums, exceptions, interfaces and types.
SQL database layer.
Logic specific to the database layer.
This layer contains all business logic. It is dependent on the core/domain layer but has no dependencies on any other layer or project. This layer defines interfaces that are implemented by outside layers. For example, if the application needs to access a notification service, a new interface would be added to the application and implementation would be created within the infrastructure.
This layer contains classes for accessing external resources such as file systems, web services, SMTP, and so on. These classes should be based on interfaces defined within the application layer.
This layer is for all Apis or other ASP.NET Core projects. This layer depends on both the Core and Infrastructure layers, however, the dependency on Infrastructure is only to support dependency injection. Therefore only Startup.cs should reference Infrastructure.