示例#1
0
 public static void AddReminder(Reminder reminder)
 {
     using (var context = new ReminderDBContext())
     {
         reminder.DeleteDatabaseValues();
         context.Reminders.Add(reminder);
         context.SaveChanges();
     }
 }
示例#2
0
 public static void DeleteReminder(Reminder selectedReminder)
 {
     using (var context = new ReminderDBContext())
     {
         selectedReminder.DeleteDatabaseValues();
         context.Reminders.Attach(selectedReminder);
         context.Reminders.Remove(selectedReminder);
         context.SaveChanges();
     }
 }
 public static void AddReminder(Reminder reminder)
 {
     using (var context = new ReminderDBContext())
     {
         reminder.DeleteDatabaseValues();
         context.Reminders.Add(reminder);
         Console.WriteLine("rems guid ---   " + reminder.Guid);
         context.SaveChanges();
     }
 }