I have written a ValueProvider for binding model collections from records in a CSV file. The source code is available on BitBucket.
Model binding in ASP.NET MVC is responsible for binding values to the models that form the parameter arguments to the controller action matched to the route. But where do model binders get these values from? That’s where Value Providers come in; A ValueProvider provides values for model binding and there are ValueProviders for providing values from
- a parent action (if the action is a child or nested action)
- a posted form value collection
- posted JSON
- route data
- the query string
- posted files