Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CategoryDM category = serviceCategories.GetCategory(Convert.ToInt32(id));

            if (serviceCategories.DeleteCategory(category))
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(RedirectToAction("Error", new { id = id }));
            }
        }
        public async Task<IActionResult> DeleteConfirmed(int categoryId)
        {
			await _serviceCategories.DeleteCategory(categoryId);

			return RedirectToAction(nameof(Index));
        }