Exemple #1
0
 internal static bool CreateModel(ModelBindingContext bindingContext, ModelMetadata boundConstructor, object[] values)
 {
     try
     {
         bindingContext.Model = boundConstructor.BoundConstructorInvoker(values);
         return(true);
     }
     catch (Exception ex)
     {
         AddModelError(ex, bindingContext.ModelName, bindingContext);
         bindingContext.Result = ModelBindingResult.Failed();
         return(false);
     }
 }