I have in my model a property of a certain type, it’s a custom object.
This object takes a string as a ctor argument.
Is it possible to have the model binder automatic insert a string from a form into the ctor of the particular object ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
yes it is. With a custom model binder, you can explicitly control exactly how values are used to construct your object. This can include route values, form posted values as well as values from the session store.