public IDbContextReadOnlyScope CreateReadOnlyWithTransaction(IsolationLevel isolationLevel) { checkDisposed(); var scope = new DbContextReadOnlyScope( DbContextScopeOption.ForceCreateNew, isolationLevel, _ambientDbContextFactory, _loggerFactory, _scopeDiagnostic); _disposables.Add(new WeakReference <IDisposable>(scope)); return(scope); }
public IDbContextReadOnlyScope CreateReadOnly(DbContextScopeOption joiningOption = DbContextScopeOption.JoinExisting) { checkDisposed(); var scope = new DbContextReadOnlyScope( joiningOption, null, _ambientDbContextFactory, _loggerFactory, _scopeDiagnostic); _disposables.Add(new WeakReference <IDisposable>(scope)); return(scope); }