//the main purpose of this method is to release resources that we have used inside this employee
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();  //release "db" resource, instance of DBContext()
     }
     base.Dispose(disposing);
 }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Esempio n. 3
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             _context.Dispose();
         }
     }
     this.disposed = true;
 }