protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected virtual void Dispose(bool disposing) { if (!disposed) { moviecontext.Dispose(); disposed = true; } }
protected override void Dispose(bool disposing) { if (disposing) { // Calls the protected Dispose method db.Dispose(); } // Releases unmanaged resources and optionally releases managed resources base.Dispose(disposing); }
protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { _context.Dispose(); } } disposed = true; }
protected override void Dispose(bool disposing) { //Random rnd = new Random(); //int rd = rnd.Next(1, 1000); //testMethod(rd); if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { context.Dispose(); } } this.disposed = true; }
private async Task asynctask(ThreadParam p) { //return await Task.Run(() => { MovieDBContext tmpdb = new MovieDBContext(); p.to = tmpdb.Movies.ToList(); tmpdb.Dispose(); ViewBag.asyncThreadid2 = Thread.CurrentThread.ManagedThreadId; await Task.Delay(100); // return 0; // }); }
private static int testMethodDelegate(int tm, MoviesController ctl) { if (!ctl.ms.mClient.KeyExists("xxxxxx2")) { MovieDBContext tmpdb = new MovieDBContext(); Movie mv = tmpdb.Movies.Find(6); tmpdb.Dispose(); } int tmp = 1; for (int i = 0; i < tm * 1000; i++) { Random rnd = new Random(); int rd = rnd.Next(1, 1000); tmp = (tmp * rd) % 999999999; } ctl.ViewBag.asyncThreadid2 = Thread.CurrentThread.ManagedThreadId; return(tmp); }
public void Dispose() { Context.Dispose(); }
protected override void Dispose(bool disposing) { _context.Dispose(); }
public void Dispose() { _context.Dispose(); }