I am new to ASP.NET MVC, but previously used many of the Model-View-Controller frameworks.
I recently met an agreement to collect the data that you need in your specific view (indeed, they are assigned by ViewData) to a new class called (NameOfView) ViewModel .
Collecting this data so that it is associated with the functions provided by the View / Controller interaction hit me as an auxiliary structure or even a closing mechanism (in “encapsulates the meaning of a set of variables”).
So why is it called "ViewModel", given that it is neither a view nor a model?
Does anyone else find this name confusing?
EDIT : what's wrong with just placing the properties in the view so that the controller can populate them (as in other MVC environments)?
asp.net-mvc viewmodel
JBRWilkinson
source share