How can I assign more than one ValueProvider to ModelBindingContext when testing a custom model bind

Posted by Byron Sommardahl on Stack Overflow See other posts from Stack Overflow or by Byron Sommardahl
Published on 2010-06-11T13:59:57Z Indexed on 2010/06/11 14:03 UTC
Read the original article Hit count: 548

Filed under:
|

I have a custom model binder that uses data from session, tempdata, and form collection (hypothetically, of course!). When testing my model binder, need to create a ModelBindingContext with a ValueProvider. Trouble is, I can't see how I can have one ValueProvider that serves multiple value provider types. Any words of wisdom?

ValidModelBindingContext = new ModelBindingContext
                           {
                              ModelName = "SomeModel",
                              ValueProvider = ValidFormValueCollection
                           };

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about modelbinders