protected virtual IModelBinder GetBinder(ParameterDescriptor parameter) { return parameter.Binding.Binder ?? Binders.GetBinder(parameter.Type); }
protected virtual object GetParameterValue(ControllerContext context, ParameterDescriptor parameter) { Precondition.Require(context, () => Error.ArgumentNull("context")); Precondition.Require(parameter, () => Error.ArgumentNull("parameter")); IModelBinder binder = GetBinder(parameter); BindingContext bc = new BindingContext(context, parameter.Type, parameter.Binding.Name, GetValueProvider(context, parameter.Binding.Source), GetController().ModelState); bc.FallbackToEmptyPrefix = (String.Equals(parameter.Binding.Name, parameter.Name)); return binder.Bind(bc) ?? parameter.Binding.DefaultValue; }
protected virtual IModelBinder GetBinder(ParameterDescriptor parameter) { return(parameter.Binding.Binder ?? Binders.GetBinder(parameter.Type)); }