public ActionResult DeleteConfirmed(long id) { NotificationAlert.Notification notification = _context.Notifications.Find(id); _context.Notifications.Remove(notification); _context.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Change([Bind(Include = "NotificationId,Title,NotificationType,Controller,Action,UserId,IsDismissed")] NotificationAlert.Notification notification) { if (ModelState.IsValid) { _context.Entry(notification).State = EntityState.Modified; _context.SaveChanges(); return(RedirectToAction("Index")); } return(View(notification)); }
// GET: Notifications/Delete/5 public ActionResult Remove(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NotificationAlert.Notification notification = _context.Notifications.Find(id.Value); if (notification == null) { return(HttpNotFound()); } return(View(notification)); }