asp.net mvc 4 - Where to write ViewModel class in MVC4 -


i have 1 doubt write viewmodel class in mvc4. see there 2 folder called models , viewmodel. in case of writing parentmodel , viewmodel class, under folder have write it.

my suggestion create viewmodels folder , keep view-models in creating hierarchy same views folder in it.

like suppose have index.cshtml , about.cshtml in

view -> home

folder, put view-models defined index , about in

viewmodels -> home -> indexviewmodel.cs

and

viewmodels -> home -> aboutviewmodel.cs

this helps keep code separation in development. hope got idea. thank you.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -