I am attempting to upgrade my MVC 1 project to MVC 2 RC. We currently have a custom modelbinder that adds items to the ValueProvider (this worked when it was a dictionary). We then passed this off to the default modelbinder. However, IValueProvider does not have an add method, so this algorithm no longer works. Does anyone know of a way to add values to the ValueProvider in MVC 2?
foreach(string valKey in controllerContext.RequestContext.HttpContext.Request.Form.AllKeys.Where(x => x.StartsWith(valuesToChangePrefix)))
{
string valName = valKey.Substring(valuesToChangePrefix.Length);
string myVal = ManipulateValue(bindingContext.ValueProvider.GetValue(valKey).AttemptedValue);
// This is where I need to add to my value Provider (As you can see I used to just assign a ValueProviderResult
//bindingContext.ValueProvider = new ValueProviderResult(myVal.Split(','), myVal, bindingContext.ValueProvider.GetValue(valKey).Culture);
}