Exemple #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Exemple #2
0
        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;
 }
Exemple #5
0
 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);
 }
Exemple #6
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             context.Dispose();
         }
     }
     this.disposed = true;
 }
Exemple #7
0
        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;
            // });
        }
Exemple #8
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);
        }
Exemple #9
0
 public void Dispose()
 {
     Context.Dispose();
 }
Exemple #10
0
 protected override void Dispose(bool disposing)
 {
     _context.Dispose();
 }
Exemple #11
0
 public void Dispose()
 {
     _context.Dispose();
 }