Im doing a .NET solution and i have to architect this. So my architecture is like below.
- DLL(data logic layer) (Where i have all my repositories to access data)
- Models(In a schema wise)
- ViewModels(Separately as class library )
- Services Layer (Where manipulate data and sends to controller)
Here DLL will sent the data by accessing DB. Then Service layer will use these Repositories (etc. UserRepository) and manipulate the data as i want to send it to controller. In this case controller will return the ViewModels to views. So what i wanna know is, when mapping data to ViewModels ,Should my service layer do mappings and return ViewModels to Controller ?? OR Service Layer return as Models and in controller we do the mapping and create view models ?
What i feels is it is not good to have so many operations in the controller. So my service should return ViewModels ,So the controller have less work.
I would like to hear best practices and ideas ??