mvcarchitecture icon indicating copy to clipboard operation
mvcarchitecture copied to clipboard

The Models folder is missing on Store.Web?

Open neonleo opened this issue 6 years ago • 1 comments

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?

neonleo avatar Jun 20 '18 17:06 neonleo

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.

taciolitke avatar Mar 25 '20 15:03 taciolitke