protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
예제 #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             context.Dispose();
         }
     }
     this.disposed = true;
 }
 protected override void Dispose_context()
 {
     RunWithoutException(CleanupActionsAfterTest);
     RunWithoutException(() => Context.SaveChanges());
     RunWithoutException(() => Context?.Dispose());
 }
        public static void Destroy(ShoppingDbContext context)
        {
            context.Database.EnsureDeleted();

            context.Dispose();
        }
        //public int SaveChanges() {
        //    return Db.SaveChanges();
        //}

        public void Dispose()
        {
            Db.Dispose();
        }