This is probably not a clear answer, depending on the size and volume of your application, but in combination with the service layer, I try to make the "M" MVC a more View Model.
Like MVVM, the model becomes a flat object that contains only the properties that will be displayed in the view. The controller accesses the service layer and then uses AutoMapper to map the properties of the domain objects to the model.
As a result, you get thin controllers and thin models, and most of the logic remains at your level of service. The only time the model really has any logic is either matching lists (like the StateObjects list), or SelectLists, or other view-related functions / calculations. It also makes it easy to map a model to a JSON object if you are doing any kind of asynchronous JavaScript development because the models are relatively flat.
If your model directly refers to your level of service, you should pass all your services to the constructor if you are trying to use some type of dependency injection, which can make the Model instance an actual pain.
I donβt know if this violates the MVC paradigm, but it worked well in projects that I have done in the past.
source share