コード例 #1
0
 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));
     }
 }
コード例 #2
0
 public ActionResult DeleteCategories(int Id)
 {
     categoriesRepository.DeleteCategories(Id);
     TempData["Message"] = "Categories deleted successfully";
     return(RedirectToAction("Index"));
 }
コード例 #3
0
 public void DeleteCategories(int Id)
 {
     categoriesRepository.DeleteCategories(Id);
 }