Пример #1
0
        public async Task <IActionResult> RemoveCustomer(int id)
        {
            var result = await _customerFactory.DeleteObject($"api/customer/{id}");

            if (!result)
            {
                ViewData["Message"] = "Something wrong";
                return(RedirectToAction("Index"));
            }

            ViewData["MessageSuccess"] = "Customer deleted";
            return(RedirectToAction("Index"));
        }