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); }
public TFormatted ExecuteCommand <TFormatted>(FogbugzCommand command, Func <XDocument, TFormatted> conversionFunc) { var response = this.ExecuteCommand(command); return(conversionFunc(response)); }