I have a question about the 'Models' folder or layer in a ASP.NET MVC or Web API application (I'm using Web API, but should apply to both based on what I'm asking). See in all the basic examples on trying to use MVC or Web API as the entire architecture, the 'Models' folder is typically populated with classes like Customer
, Orders
, Address
, etc.
However, all of my entities have been extracted out to their own domain/business layer and therefore I have no model classes in the UI layer.
Now I still need ViewModels to be the final shaped data for my MVC apps, but regardless for MVC where I need views or Web API where the injected repository returns the shaped data without a view, I still have no need for the 'Models' folder in my UI layer when porting out those entities to another separate layer.
Is this OK? In the case of using MVC where I still may not have any Model classes in the UI layer, does the 'Models' folder need to rather contain my ViewModels as discussed here? Fat model / thin controller vs. Service layer I think leaving the 'Models' folder empty and creating a separate 'ViewModels' folder makes more sense to show the Models exist, but are in another layer.
Help is appreciated on each question within, thanks!