public object Bind(HttpContextBase httpContext, ParameterDescriptor descriptor) { var binder = new DataBinder(); var node = new TreeBuilder().BuildSourceNode(httpContext.Request.Params); return binder.BindObject(descriptor.Type, Prefix ?? descriptor.Name, Exclude, Allow, node); }
private void InspectMethodInfo() { Name = method.Name; foreach (var parameter in method.GetParameters()) { var descriptor = new ParameterDescriptor(parameter.Name, parameter.ParameterType); Parameters.Add(descriptor.Name, descriptor); foreach (var attr in parameter.GetCustomAttributes(false)) { if (attr is IActionParameterBinder) { descriptor.CustomBinder = (IActionParameterBinder) attr; break; } } } }