Beispiel #1
0
 private Task DeleteTask()
 {
     using (var context = new NoteContext())
     {
         if (listBoxNotes != null)
         {
             context.Remove(NOTE);
             context.SaveChanges();
         }
     }
     return(Task.CompletedTask);
 }
Beispiel #2
0
 private Task SaveTask()
 {
     using (var context = new NoteContext())
     {
         foreach (Note item in listBoxNotes.Items)
         {
             context.Update(item);
             context.SaveChanges();
         }
     }
     return(Task.CompletedTask);
 }
Beispiel #3
0
 private Task AddTask()
 {
     using (var context = new NoteContext())
     {
         var note = new Note()
         {
             Text      = textBoxInputText.Text,
             Actuality = false
         };
         context.Add(note);
         context.SaveChanges();
     }
     return(Task.CompletedTask);
 }