public IEnumerable <SalesArticle> Search(string searchTerm) { var uri = new Uri($"{this.rootUri}/linnapps-api/sales-articles/search?searchTerm={searchTerm}", UriKind.RelativeOrAbsolute); var response = this.restClient.Get( CancellationToken.None, uri, new Dictionary <string, string>(), DefaultHeaders.JsonGetHeaders()).Result; if (response.StatusCode != HttpStatusCode.OK) { throw new ProxyException($"Error trying to execute search"); } var json = new JsonSerializer(); return(json.Deserialize <IEnumerable <SalesArticle> >(response.Value)); }
public IEnumerable <StockPool> GetStockPools() { var uri = new Uri($"{this.rootUri}/linnapps-api/stock-pools", UriKind.RelativeOrAbsolute); var response = this.restClient.Get( CancellationToken.None, uri, new Dictionary <string, string>(), DefaultHeaders.JsonGetHeaders()).Result; if (response.StatusCode != HttpStatusCode.OK) { throw new ProxyException($"Error trying to get stock pools"); } var json = new JsonSerializer(); return(json.Deserialize <IEnumerable <StockPool> >(response.Value)); }