// WebApi 2 will call this automatically after each // request. You need this to ensure your context is disposed // and the memory it is using is freed when your app does garbage // collection. protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
public void Dispose() { _db.Dispose(); }