Patch to UriTemplateProcessor to support query strings

Topics: Web Api
Coordinator
Dec 15, 2010 at 4:00 PM

Hi guys

There is a bug in in the current bits that prevents query string params from working. This will be fixed in our next drop, but in the meanwhile here is the code fix. Go to UriTemplateProcessor and replace OnGetOutArguments with the following code.

        protected override IEnumerable<ProcessorArgument> OnGetOutArguments()
        {
            var pathArgs = this.template.PathSegmentVariableNames
                    .Select(s => new ProcessorArgument(
                                          s.ToLowerInvariant(),
                                          stringType));

            var querystringArgs = this.template.QueryValueVariableNames
                    .Select(s => new ProcessorArgument(
                                          s.ToLowerInvariant(),
                                          stringType));

            return pathArgs.Concat(querystringArgs);
        }