I began using ViewModels to create custom views that represent several underlying EF entities in MVC4. I created a folder named ‘ViewModels’ in my MVC project and have my classes within that folder. What I want to do is create a new view based on the strongly typed ViewModel class. However the wizzard displayed when creating a View in ASP.NET MVC with the “Create a strongly-typed view” option and subsequent “Model Class” dropdown selection does not contain my ViewModel class. The only classes listed are those from my Entity Framework model.
How do I create a View based on my created ViewModel class or rather get it to show in that list of Model classes?
Thanks!
You need to compile the MVC project before the new ViewModel class will show up in that dropdown.