public FinanceManager() { db = new FinanceRepository(); _disposed = false; //SERIALIZE WILL FAIL WITH PROXIED ENTITIES //dbContext.Configuration.ProxyCreationEnabled = false; //ENABLING COULD CAUSE ENDLESS LOOPS AND PERFORMANCE PROBLEMS //dbContext.Configuration.LazyLoadingEnabled = false; }
protected virtual void Dispose(bool disposing) { if (!_disposed) { if (disposing) { if (db != null) { db.Dispose(); } } db = null; _disposed = true; } }