In this repository I have prepared a clean architectural Template for visual studio so you can start your project very quickly with clean architecture!
1. Download zip file of lastest release : link
3. Go to visual studio -> create new project dialog You will see the newly created template as shown below.
In this layer there are tools and classes that perhaps they be used in All layers . Actually this layer has nothing to do with project subject and utilities of this layer help us to Improve codding and prevents duplication of classes or methods. In this layer we have :
- PersianDate.cs
- Resources : *.resx
- SeparationMoney.cs
- StringExtensions.cs
- SecutrityHelper.cs
Also, according to the definition of this layer, shared libraries are located in this area. you can more study about shared libraries in this link
This will contain all entities, enums, exceptions, interfaces (Interfaeces of repository), types and logic specific to the domain layer.
Also in this layer we have some base classes for example :
- Settings file
- BaseEntity.cs
- BaseEvent.cs
- BaseMessage.cs
- LifieTime interfaces
Application layer contains business logic and types :
- Application Interfaces
- View Models / DTOs
- Mappers
- Application Exceptions
- Validation
- Logic
This is the Application of your Domain use to implement the use cases for your business. This provides the mapping from your domain models to one or more view models or DTOs. Validation also goes into this layer…
- Database
- Web services
- Files
- Message Bus
- Logging
- Configuration
The Infrastructure Layer will implement interfaces from the Application Layer to provide functionality to access external systems. These will be hooked up by the IoC container, usually in the Presentation Layer. The Presentation Layer will usually have a reference to the Infrastructure Layer, but only to register the dependencies with the IoC container. This can be avoided with IoC containers like Autofac with the use of Registries and assembly scanning
In this layer we have everything that is about the configurations of the Presentation layer framework :
- ApiResult.cs
- Middlewares
- Filters
- Asp.net core config …
- MVC Controllers
- Web API Controllers
- Swagger / NSwag
- Authentication / Authorisation
The Presentation Layer is the entry point to the system from the user’s point of view.