Example #1
0
 public void Add(Notification notification)
 {
     using (var dbContext = new MedialynxDbNotificationsContext()) {
         dbContext.Notifications.Add(notification);
         dbContext.SaveChanges();
     }
 }
Example #2
0
 public void Update(Notification notification)
 {
     using (var dbContext = new MedialynxDbNotificationsContext()) {
         Notification existsNotification = dbContext.Notifications.FirstOrDefault(n => n != null && n.Id == notification.Id);
         if (existsNotification != null)
         {
             if (Utils.CopyPropertyValues <Notification>(notification, existsNotification))
             {
                 dbContext.Notifications.Update(existsNotification);
                 dbContext.SaveChanges();
             }
         }
     }
 }