public Response <int> DeleteCategories(Categories categories) { try { var deleteCount = _categoriesRepository.DeleteCategories(categories); return(new Response <int>(true, "Success", deleteCount)); } catch (Exception e) { _logger.Error($"DeleteCategories Failed: {e.Message}\n {e.StackTrace}"); return(new Response <int>(false, e.Message, 0)); } }
public ActionResult DeleteCategories(int Id) { categoriesRepository.DeleteCategories(Id); TempData["Message"] = "Categories deleted successfully"; return(RedirectToAction("Index")); }
public void DeleteCategories(int Id) { categoriesRepository.DeleteCategories(Id); }