コード例 #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 }));
            }
        }
コード例 #2
0
        public async Task<IActionResult> DeleteConfirmed(int categoryId)
        {
			await _serviceCategories.DeleteCategory(categoryId);

			return RedirectToAction(nameof(Index));
        }