protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { if (disposing) { phoneBookContext.Dispose(); } base.Dispose(disposing); }
protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { context.Dispose(); } } this.disposed = true; }
public static void Destroy(PhoneBookContext context) { context.Database.EnsureDeleted(); context.Dispose(); }
//Represents a method that dispose the context of the database public void Dispose() { Commit(); context.Dispose(); }