protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
/* * 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()); }
public virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { db.Dispose(); } this.disposed = true; } }
protected virtual void Dispose(bool dispose) { if (!this.disposed) { if (dispose) { _context.Dispose(); } } this.disposed = true; }