public static AddItemToShoppingListContract ToContract(this AddItemToShoppingListRequest request) { return(new AddItemToShoppingListContract { ShoppingListId = request.ShoppingListId, ItemId = request.ItemId.ToContract(), SectionId = request.SectionId, Quantity = request.Quantity }); }
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()); }