Example #1
0
 /// <summary>
 /// Saves the changes.
 /// </summary>
 public void SaveChanges()
 {
     try
     {
         context.SaveChanges();
     }
     catch (Exception ex)
     {
         //TODO: Add logging.
     }
 }
Example #2
0
        public static void ClearDataInDatabase()
        {
            using (var context = new RockPapercContext())
            {
                context.Database.ExecuteSqlCommand("DELETE FROM Rounds");
                context.Database.ExecuteSqlCommand("DELETE FROM Games");
                context.Database.ExecuteSqlCommand("DELETE FROM Teams");

                context.SaveChanges();
            }
        }
Example #3
0
 /// <summary>
 /// Saves the changes.
 /// </summary>
 public void SaveChanges()
 {
     try
     {
         context.SaveChanges();
         //context.Dispose();
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
     }
 }