I am trying to add multiple models to a single view using a ViewModel with Code First approach in Asp.Net MVC 5. Each domain model has its own CRUD operations. I want the ViewModel to have CRUD operations for each domain model. The ViewModelController would have a CRUD operations respective to domain models. All examples I seen so far only show how to add meta data with out CRUD operations. I tried using the Contoso University example MS provides; however, I can not extrapolate what I am trying to achieve from example. What I am trying to do seems so practical but difficult to achieve with poor MS documentation. To give you a better idea what I am trying to achieve, take indeed for example, each category in the resume section has a CRUD operation.
Asked
Active
Viewed 139 times
1 Answers
0
I guess, you have misunderstanding about ViewModel purpose, look at this topic

Ali Mardan
- 147
- 5
-
This solidified my understanding of ViewModels:"ASP.NET MVC view can't have more than one model so if we need to display properties from more than one models into the view, it is not possible. ViewModel serves this purpose." Thanks for the link. – Jacob Crosby Dec 10 '18 at 21:04