示例#1
0
        public async Task <ActionResult> DeleteProduct(int productId)
        {
            if (ModelState.IsValid)
            {
                await adminApi.DeleteProductAsync(productId);

                TempData["message"] = string.Format($"{productId} was successfully deleted!");
            }
            else
            {
                TempData["message"] = string.Format($"Something went wrong, please try again later");
            }

            return(Json(new EmptyResult(), JsonRequestBehavior.AllowGet));
        }