Пример #1
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Catagory catagory  = _manager.GetById((int)id);
            bool     isDeleted = _manager.Remove(catagory);

            if (isDeleted)
            {
                return(RedirectToAction("Index"));
            }
            return(View(catagory));
        }
Пример #2
0
 public IActionResult Delete(int?id)
 {
     if (id != null && id > 0)
     {
         var  catagory = _catagoryManager.GetById(id);
         bool isdelete = _catagoryManager.Remove(catagory);
         if (isdelete)
         {
             return(RedirectToAction("List"));
         }
     }
     return(RedirectToAction("List"));
 }