Example #1
0
 /// <summary>
 /// After testing an insert or update to the database, this can be called to clear
 /// an object that failed and became stuck in the EF queue, so it does not
 /// affect subsequent tests.
 /// </summary>
 private void Cleanup()
 {
     try
     {
         _context.Entry(taskList).State = EntityState.Detached;
     }
     catch (Exception)
     { }
 }
Example #2
0
 /// <summary>
 /// After testing an insert or update to the database, this can be called to clear
 /// an object that failed and became stuck in the EF queue, so it does not
 /// affect subsequent tests.
 /// </summary>
 private void Cleanup()
 {
     try
     {
         _context.Entry(province).State = EntityState.Detached;
     }
     catch (Exception)
     { }
 }