public BaseDal(RecameDBEntities db = null, bool isReadOnly = false) { if (null == db) { if (isReadOnly) { db = new RecameDBEntities(Constants.Others.ReadOnlyDbConnectionName, true); } else { db = new RecameDBEntities(); } _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; } } }