We have to use a custom ModelBinder that implements IModelBinder. We cannot directly change this code at all. It currently doesn't have support for updating ModelState from the DataAnnotations of the model passed in. We want to subclass the ModelBinder and add that support. What do we need to do to add that support so it works like DefaultModelBinder works with DataAnnotations?
Asked
Active
Viewed 177 times
1
-
Can't you just inherit from `DefaultModelBinder`? – LukLed Jun 29 '12 at 23:40
-
You will have to provide more details. How does the model binder that you are using looks like? – Darin Dimitrov Jun 30 '12 at 08:25
-
@Darin - There's nothing much to it. It does some serialization of the object. But, what I'd like to know is how you update the data annotations to the modelstate after you have the model populated. – drogon Jul 02 '12 at 17:49
-
@LukLed --We don't own the modelbinder code, so no – drogon Jul 02 '12 at 17:49
-
Sorry, I am afraid I don't understand what you are trying to achieve. – Darin Dimitrov Jul 02 '12 at 17:51