/// <summary> /// Initializes a new instance of the <see cref="Radischevo.Wahha.Data.DbOperationScope"/> class. /// </summary> /// <param name="provider">The <see cref="Radischevo.Wahha.Data.IDbDataProvider"/> /// used to perform database queries.</param> public DbOperationScope(IDbDataProvider provider) : base() { Precondition.Require(provider, () => Error.ArgumentNull("provider")); _provider = provider; _cache = new ScopedCacheProvider(CacheProvider.Instance); _isolationLevel = IsolationLevel.ReadCommitted; }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or /// resetting unmanaged resources. /// </summary> /// <param name="disposing">A value indicating whether /// the disposal is called explicitly.</param> protected virtual void Dispose(bool disposing) { if (disposing) { if (_hasOwnedContext) { IDisposable disposable = (_provider as IDisposable); if (disposable != null) { disposable.Dispose(); } } } _provider = null; _cache = null; _disposed = true; }