コード例 #1
0
 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();
         }
     }
 }
コード例 #3
0
 protected override void Dispose(bool disposing)
 {
     using (var ctx = new SalesDbContext())
     {
         if (disposing)
         {
             ctx.Dispose();
         }
         base.Dispose(disposing);
     }
 }
コード例 #4
0
 private void Dispose(bool dispose)
 {
     if (!_disposed)
     {
         if (dispose)
         {
             _context.Dispose();
             _disposed = false;
         }
     }
 }
コード例 #5
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    if (dbContext != null)
                    {
                        dbContext.Dispose();
                    }
                }

                disposedValue = true;
            }
        }
コード例 #6
0
 public void Dispose()
 {
     // Discard any inserts since we didn't commit
     _transaction.Dispose();
     _workDbContext.Dispose();
 }