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 -

c# - Retrieve google contact -

javascript - How to insert selected radio button value into table cell -