private Uri GetRequestUri <T>(GetMatchingQueryCommand <T> command) { string requestUri = this.GetMessageBase <T>() + command.UrlSuffix; List <KeyValuePair <string, string> > queryStringParameters = new List <KeyValuePair <string, string> >(); if (command.Expand != null) { queryStringParameters.AddRange(command.Expand.Select(x => new KeyValuePair <string, string>("expand", x))); } queryStringParameters.AddRange(this.GetAdditionalParameters(command.AdditionalParameters)); queryStringParameters.ForEach(x => { requestUri = QueryHelpers.AddQueryString(requestUri, x.Key, x.Value); }); return(new Uri(requestUri, UriKind.Relative)); }
public GetMatchingQueryHttpApiCommand(GetMatchingQueryCommand <T> command, IRequestMessageBuilderFactory requestMessageBuilderFactory) { this.command = command; this.requestBuilder = requestMessageBuilderFactory.GetRequestMessageBuilder <GetMatchingQueryRequestMessageBuilder>(); }
public HttpRequestMessage GetRequestMessage <T>(GetMatchingQueryCommand <T> command) { return(this.GetRequestMessage <T>(this.GetRequestUri <T>(command), null, HttpMethod)); }