Example #1
0
 public static AddItemToShoppingListContract ToContract(this AddItemToShoppingListRequest request)
 {
     return(new AddItemToShoppingListContract
     {
         ShoppingListId = request.ShoppingListId,
         ItemId = request.ItemId.ToContract(),
         SectionId = request.SectionId,
         Quantity = request.Quantity
     });
 }
Example #2
0
        public async Task <bool> AddItemToShoppingListAsync(AddItemToShoppingListRequest request,
                                                            Func <Task> OnFailure, IAsyncRetryFragmentCreator fragmentCreator)
        {
            try
            {
                await apiClient.AddItemToShoppingListAsync(request);

                return(true);
            }
            catch (Exception e)
            {
                var fragment = fragmentCreator.CreateAsyncRetryFragment(OnFailure);
                notificationService.NotifyError("Adding item failed", e.Message, fragment);
            }

            return(false);
        }
 public async Task AddItemToShoppingListAsync(AddItemToShoppingListRequest request)
 {
     await client.AddItemToShoppingList(request.ToContract());
 }