tri_inn

tri_inn

  • NA
  • 1.2k
  • 223.1k

ASP.Net : Regarding Value Provider & Model Binder

Mar 4 2016 9:57 AM
my question is on : What’s the Difference Between a Value Provider and Model Binder
 

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?

this is not clear what hacked.com is saying

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 ?