protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Пример #2
0
        /*
         * private bool CarExists(int key)
         * {
         *  //return db.Cars.Any(p => p.Id == key);
         *  //funkcja w repo by się przydała
         *  if (db.Get(key) == null) return false; else return true;
         * }*/
        protected override void Dispose(bool disposing)
        {
            WebApiConfig.Logger.info("enter CarsController->Dispose with disposing = " + disposing.ToString());

            CarContext db = new CarContext(); //UWAGA!!!

            db.Dispose();
            base.Dispose(disposing);
            WebApiConfig.Logger.info("return from CarsController->Dispose with disposing = " + disposing.ToString());
        }
Пример #3
0
 public virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             db.Dispose();
         }
         this.disposed = true;
     }
 }
Пример #4
0
 protected virtual void Dispose(bool dispose)
 {
     if (!this.disposed)
     {
         if (dispose)
         {
             _context.Dispose();
         }
     }
     this.disposed = true;
 }