Here is an example implementation using Onion architecture: https://www.codeproject.com/Articles/1028481/Understanding-Onion-Architecture
The webpage suggests a solution structure of:
Domain - Solution Folder
Domain.Entities - Class Library Project
Domain.Interfaces - Class Library Project
Service Interfaces - Solution Folder
Service.Interfaces - Class Library
Services - Solution Folder
Services - Class Library Project
Infrastructure - Solution Folder
Infrastructure.Data - Class Library Project
User Interface - Solution Folder
MVC - MVC Project
I have a few questions:
Why are there two Solution folders in the Service Layer? i.e. Services and Services.Interfaces. I believe there should be one like in the domain layer i.e. the Domain Solution folder contains two class library projects (Domain.Entities and Domain.Interfaces). I would normally put this down to being a mistake, however I have seen other projects structured like that.
Why is the domain and services layer split into two class library projects (why not just have one class library project in each containing classes and libraries).
This question states that ALL interfaces should be contained in the domain layer. However, all the code samples I have looked at put the service layer interfaces in the service layer. Should they go in the service layer or the domain layer?