Exemple #1
0
        public async Task <IActionResult> OnPost(string SubmitAction)
        {
            UpdateList.Request request = new UpdateList.Request()
            {
                Id       = ListModel.Id,
                Name     = ListModel.Name,
                Products = ListModel.Products.Select(p => new UpdateList.RequestProduct()
                {
                    Id      = p.Id,
                    Qty     = p.Qty,
                    Deleted = p.Deleted
                })
            };

            await _updateList.Do(request);

            if (SubmitAction == "AddCart")
            {
                return(RedirectToAction("Cart", "FavList", new { id = ListModel.Id, redirectToCheckout = true }));
            }

            return(RedirectToPage("/BusinessProfile/FavouriteList/Detail", new { id = ListModel.Id }));
        }
Exemple #2
0
 public async Task <IActionResult> Post(
     [FromBody] UpdateList.Request request,
     [FromServices] UpdateList updateList) =>
 Ok(await updateList.Do(request));