I was reading a write up on What’s the Difference Between a Value Provider and Model Binder.
I understand that Model Binder basically get incoming data and build object. Suppose I am sending student data then model binder grab incoming student data when from post to server and build student object.
But still do not understand what is the job of Value Provider in MVC.
So please explain with easy sample that what kind of job done by Value Provider and what model binder does?
The DefaultModelBinder will pull the Id value from the RouteData and the Age, FirstName, and LastName values from the JSON when building up the Person object. Afterwards, it’ll perform validation without having to know that the various values came from different sources.
When i am posting id,name,age etc then why model binder will pick id only from route data and rest of data from JSON. model binder should pick all value from RouteData or all value from JSON..............so why id only ?
How many different type of value provider exist in mvc ?