public async Task <GetUserBasketItemsResponse> Get()
 {
     return(await _authorizationLayer.ExecuteAuthorizedAction(User.Identity,
                                                              id => _basketItemsRepository.GetBasketItems(id),
                                                              e => GetUserBasketItemsResponse.CreateFailedResult(e),
                                                              "An error occurred while trying to fetch the users basket items."));
 }
Example #2
0
 /// <summary>
 /// List all the items currently in the user's basket.
 /// </summary>
 /// <returns>
 /// A list of items in the user's basket and a flag to denote if the operation
 /// was successful or not - in which case an error message will be included.
 /// </returns>
 public async Task <GetUserBasketItemsResponse> ListBasketItems()
 {
     return(await GetCall(
                $"{EnvironmentService.ServiceEndpoints[KnownService.BasketService]}",
                e => { return GetUserBasketItemsResponse.CreateFailedResult(e.Message); }));
 }