protected virtual void Dispose(bool disposing) { // If you need thread safety, use a lock around these // operations, as well as in your methods that use the resource. if (!_disposed) { if (disposing) { if (dataContext != null) { dataContext.Dispose(); } } // Indicate that the instance has been disposed. dataContext = null; _disposed = true; } }
public Repository() { //dataContext = SingleDataContext.CurrentInstance(); dataContext = new InvestmentDataContext(); _disposed = false; }
public BaseService() { _dataContext = new InvestmentDataContext(); }