My website, spelldamage.com, has a rather large form that users can enter data, check boxes, and select option in. To assist the controller in passing the data to the model, I'm writing a wrapper class that has properties named the same as the fields in the form. I'm doing this so I can just call object.UpdateFrom(request.Form). Some of the fields are text, some checkboxes, some selectors, etc... The properties of the class are types that the model would want to receive, such as double, bool, etc...
My question is, does the object.UpdateFrom helper read the type the property is expecting and cast the value to the correct type? For example, can it cast a checkbox to a boolean or a text field to a double?
Thanks in advance!
Did I answer your question(s)? Phweew...