コード例 #1
0
 /// <summary>
 /// deletese a notification from the database
 /// </summary>
 /// <param name="db">db Context</param>
 /// <param name="notification">notification from db</param>
 public static void DeleteNotification(ApplicationDbContext db, Notifications notification)
 {
     db.Notifications.Remove(notification);
     db.SaveChanges();
 }
コード例 #2
0
 /// <summary>
 /// Adds a notification to the db.
 /// </summary>
 /// <param name="db"></param>
 /// <param name="notifications"></param>
 public static void AddNotification(ApplicationDbContext db, Notifications notifications)
 {
     db.Notifications.Add(notifications);
     db.SaveChanges();
 }