1
J'essaie de modifier le classeur de modèle personnalisé suivant en fonction des modifications de rupture ValueProvider dans MVC 2 Beta.Asp.Net MVC 2 Beta ModelBinder Modification
protected override void OnModelUpdated(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
var obj = bindingContext.Model as Core.BusinessBase;
if (obj != null)
{
var errors = from r in obj.BrokenRulesCollection
where r.Severity == Validation.RuleSeverity.Error
select r;
foreach (var item in errors)
{
bindingContext.ModelState.AddModelError(item.Property, item.Description);
//Was -> bindingContext.ModelState.SetModelValue(item.Property, bindingContext.ValueProvider[item.Property]);
bindingContext.ModelState.SetModelValue(item.Property, bindingContext.ValueProvider.GetValue(controllerContext, item.Property));
}
}
else
base.OnModelUpdated(controllerContext, bindingContext);
}
Le problème est cette ligne revient toujours comme nul
BindingContext.ValueProvider.GetValue(controllerContext, item.Property)
Toutes les idées?