Пример #1
0
 public IActionResult Delete(int id)
 {
     if (_repository.Delete(id))
     {
         return(NoContent());
     }
     return(NotFound());
 }
Пример #2
0
        public ActionResult Delete(int?i)
        {
            if (Session["UserID"] != null && Session["UserType"].ToString().ToLower() == "chef")
            {
                if (i != null)
                {
                    mRepo.Delete((int)i);
                }
                return(RedirectToAction("Index", "Chef"));
            }

            return(RedirectToAction("Login", "Home", new { area = "" }));
        }