public IActionResult DeletePost(int?id) { var obj = _appTypeRepo.Find(id.GetValueOrDefault()); if (obj == null) { return(NotFound()); } _appTypeRepo.Remove(obj); _appTypeRepo.Save(); return(RedirectToAction("Index")); }
public IActionResult DeleteConfirmed(int?id) { if (id == 0 || id == null) { return(NotFound()); } var obj = _appTypeRepo.Find(id.GetValueOrDefault()); _appTypeRepo.Remove(obj); _appTypeRepo.Save(); TempData[WebConstants.Success] = "Action Successfull!"; return(RedirectToAction("Index")); }
public IActionResult DeletePost(int?id) { var obj = _appTypeRepo.Find(id.GetValueOrDefault()); if (obj == null) { return(NotFound()); } _appTypeRepo.Remove(obj); _appTypeRepo.Save(); TempData[WC.Success] = "Action completed successfully"; return(RedirectToAction("Index")); }