Esempio n. 1
0
        private Uri GetRequestUri <T>(GetMatchingCommand <T> command)
        {
            string requestUri = this.GetMessageBase <T>();

            requestUri += "/matching";
            List <KeyValuePair <string, string> > queryStringParameters = new List <KeyValuePair <string, string> >();

            queryStringParameters.AddRange(this.GetAdditionalParameters(command.AdditionalParameters));
            queryStringParameters.ForEach(x => { requestUri = QueryHelpers.AddQueryString(requestUri, x.Key, x.Value); });
            return(new Uri(requestUri, UriKind.Relative));
        }
Esempio n. 2
0
 public HttpRequestMessage GetRequestMessage <T>(GetMatchingCommand <T> command)
 {
     return(this.GetRequestMessage <T>(this.GetRequestUri <T>(command), this.GetHttpContent <T>(command), HttpMethod));
 }
Esempio n. 3
0
 private HttpContent GetHttpContent <T>(GetMatchingCommand <T> command)
 {
     return(new StringContent(this.serializerService.Serialize(command.Parameters)));
 }
Esempio n. 4
0
 public GetMatchingHttpApiCommand(GetMatchingCommand <T> command, IRequestMessageBuilderFactory requestMessageBuilderFactory)
 {
     this.command        = command;
     this.requestBuilder = requestMessageBuilderFactory.GetRequestMessageBuilder <GetMatchingRequestMessageBuilder>();
 }