public static void AddUser(User user)
 {
     using (var context = new EditorDBContext())
     {
         context.Users.Add(user);
         context.SaveChanges();
     }
 }
 public static void DeleteQuery(Query selectedQuery)
 {
     using (var context = new EditorDBContext())
     {
         selectedQuery.DeleteDatabaseValues();
         context.Queries.Remove(selectedQuery);
         context.SaveChanges();
     }
 }
 public static void SaveQuery(Query query)
 {
     using (var context = new EditorDBContext())
     {
         query.DeleteDatabaseValues();
         context.Entry(query).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
 public static void AddQuery(Query query)
 {
     using (var context = new EditorDBContext())
     {
         query.DeleteDatabaseValues();
         context.Queries.Add(query);
         context.SaveChanges();
     }
 }