protected override ReadResult GetRequest(string data, ReaderContext context) { var instance = context.ReadType.TryCreate(); if (instance == null) { throw new RequestTypeCreationException( context.ReadType, _actionMethod); } var actionParameters = context.ReadType.Properties .Select(x => new ActionParameter(_actionMethod, x)); var values = data.ParseQueryString(); return(_parameterBinder.Bind(values, actionParameters, (p, v) => p.BindProperty(instance, v), () => ReadResult.Success(instance), ReadResult.Failure)); }
/// <summary> /// Binds the parameters. /// </summary> /// <param name="parameters">The parameters.</param> public void BindParameters(Parameters parameters) { OptionsBound = ParameterBinder.Bind <T>(parameters); }