public async Task <CustomerBasket> GetBasketAsync(string guidUser, string token) { var builder = new UriBuilder(GlobalSetting.Instance.BasketEndpoint) { Path = $"{ApiUrlBase}/{guidUser}" }; var uri = builder.ToString(); CustomerBasket basket = await _requestProvider.GetAsync <CustomerBasket>(uri, token); _fixUriService.FixBasketItemPictureUri(basket?.Items); return(basket); }
public async Task <CustomerBasket> GetBasketAsync(string guidUser, string token) { var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/{guidUser}"); CustomerBasket basket; try { basket = await _requestProvider.GetAsync <CustomerBasket>(uri, token); } catch (HttpRequestExceptionEx exception) when(exception.HttpCode == System.Net.HttpStatusCode.NotFound) { basket = null; } _fixUriService.FixBasketItemPictureUri(basket?.Items); return(basket); }
public async Task <CustomerBasket> GetBasketAsync(string guidUser, string token) { var builder = new UriBuilder(GlobalSetting.Instance.BaseEndpoint) { Path = $"{ApiUrlBase}/{guidUser}" }; var uri = builder.ToString(); CustomerBasket basket; try { basket = await _requestProvider.GetAsync <CustomerBasket>(uri, token); } catch (HttpRequestExceptionEx exception) when(exception.HttpCode == System.Net.HttpStatusCode.NotFound) { basket = null; } _fixUriService.FixBasketItemPictureUri(basket?.Items); return(basket); }