I have example code in which the signature of the Create action menthod in the controller looks like this:
[HttpPost]
public ActionResult Create(JobCardViewData viewData)
I have just created a new MVC application and the same signature looks like this:
[HttpPost]
public ActionResult Create(FormCollection collection)
I would prefer to know how to implement my action methods like the top example, or at least how to convert from the FormCollection to a business object without going as low level as using Reflection.
Personally I avoid using
FormCollectionas it is a collection of magic strings. I would recommend you to always use this signature:and leave the model binder do the job of parsing the request parameters into a strongly typed object (you don’t need to resort to reflection or doing anything).