mvcarchitecture
mvcarchitecture copied to clipboard
The Models folder is missing on Store.Web?
Just learning how to build ASP.NET core 2 project in repo pattern, but I wonder how's the models folder going on Web?
I understand the entity model is goes to Store.Model, however I wonder there is no place for Models folder in Web side?
You need to mapper from the Model to a ViewModel, as in HomeController
viewModelGadgets = Mapper.Map<IEnumerable<Category>, IEnumerable<CategoryViewModel>>(categories);
This conceptes is used in others types of projects, such as API projects, where the API returns what it needs.
Category is an entity, for reasons of security and good practices, it is not recommended to return your mirror.