Esempio n. 1
0
        public XDocument ExecuteCommand(FogbugzCommand command)
        {
            XDocument response;

            try
            {
                var queryString = command.ToQueryString();
                // FR For the love of the coding god, the token! We have it in the client, why we are not adding it automatically to the querystring??
                if (!String.IsNullOrWhiteSpace(this.Token))
                {
                    queryString += $"&token={this.Token}";
                }

                response = this.httpClient.ExecuteQuery(queryString);
            }
            catch (Exception e)
            {
                throw new FogbugzException("An error occurred while communicating with Fogbugz.", e);
            }

            if (this.ResponseContainsError(response))
            {
                throw new FogbugzException(this.errorElement);
            }

            return(response);
        }
Esempio n. 2
0
        public TFormatted ExecuteCommand <TFormatted>(FogbugzCommand command, Func <XDocument, TFormatted> conversionFunc)
        {
            var response = this.ExecuteCommand(command);

            return(conversionFunc(response));
        }