Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Models folder is missing on Store.Web? #3

Open
neonleo opened this issue Jun 20, 2018 · 1 comment
Open

The Models folder is missing on Store.Web? #3

neonleo opened this issue Jun 20, 2018 · 1 comment

Comments

@neonleo
Copy link

neonleo commented Jun 20, 2018

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?

@taciolitke
Copy link

taciolitke commented Mar 25, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants