asp.net mvc - Advantages and Disadvantages of having a ViewModel for every Model -


this question has answer here:

i have mvc app pass models controllers. have handful of situations use viewmodel crud operations done directly. have data annotations on each property in model class use validate model. have heard better practice use viewmodels- 1 each view. seems me unnecessary , programmers nightmare far maintenance concerned. wondering if agreed or disagreed me on this?

i think terms "model" , "viewmodel" confused.

in microsoft-tutorial-mvc-world "model" maps directly database "entity" , can perform crud operations. in medium-large scale asp.net mvc app this.

therefore, build set of "view-related-business-objects" pass backward , forward , views. call them "models" if like. call them "viewmodels" if like. doesn't matter. perform same function. both put "m" in "mvc".


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -