예제 #1
0
 /// <summary>
 /// Get all the sticky notes inside the database.
 /// </summary>
 /// <returns></returns>
 public static List <StickyNote> GetStickyNotes()
 {
     using (var database = new NoteContext())
     {
         return(database.Notes.ToList());
     }
 }
예제 #2
0
 /// <summary>
 /// Saves a sticky note inside the database.
 /// </summary>
 /// <param name="stickyNote"></param>
 /// <returns></returns>
 public static void SaveStickyNote(StickyNote stickyNote)
 {
     using (var database = new NoteContext())
     {
         database.Notes.Add(stickyNote);
         database.SaveChanges();
     }
 }