Esempio n. 1
0
        public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            string paymentMethodSystemName = bindingContext.ValueProvider.GetValue("SystemName").AttemptedValue;

            bindingContext.ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(null, PaymentMethodViewModelResolver.Resolve(paymentMethodSystemName).GetType());
            object model = base.BindModel(controllerContext, bindingContext);

            return(model);
        }
Esempio n. 2
0
        public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            string controllerName = controllerContext.HttpContext.Request.Form.Get("SystemName");

            bindingContext.ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(null, PaymentMethodViewModelResolver.Resolve(controllerName).GetType());
            object model = base.BindModel(controllerContext, bindingContext);

            return(model);
        }