public BaseDal(BisolDBEntities db = null, bool isReadOnly = false) { if (null == db) { if (isReadOnly) { db = new BisolDBEntities(Constants.Others.ReadOnlyDbConnectionName, true); } else { db = new BisolDBEntities(); } _contextCreatedHere = true; } _db = db; }
protected virtual void Dispose(bool disposing) { if (disposing) { if (Transaction != null) { Transaction.Dispose(); Transaction = null; } if (_db != null) { if (_contextCreatedHere) { db.Dispose(); } _db = null; } } }