public LockUnitOfWorkScope(object syncRoot, IUnitOfWorkScopeProvider unitOfWorkScopeProvider) { #region Contracts if (syncRoot == null) throw new ArgumentNullException(); if (unitOfWorkScopeProvider == null) throw new ArgumentNullException(); #endregion // Arguments _syncRoot = syncRoot; // Enter try { // Monitor Monitor.Enter(_syncRoot); // UnitOfWorkScope _unitOfWorkScope = unitOfWorkScopeProvider.Create(); if (_unitOfWorkScope == null) throw new InvalidOperationException(); } catch { // Dispose this.Dispose(); // Throw throw; } }
public LockUnitOfWorkScopeProvider(object syncRoot, IUnitOfWorkScopeProvider unitOfWorkScopeProvider) { #region Contracts if (syncRoot == null) throw new ArgumentNullException(); if (unitOfWorkScopeProvider == null) throw new ArgumentNullException(); #endregion // Arguments _syncRoot = syncRoot; _unitOfWorkScopeProvider = unitOfWorkScopeProvider; }
public LockUnitOfWorkScopeProvider(object syncRoot, IUnitOfWorkScopeProvider unitOfWorkScopeProvider) { #region Contracts if (syncRoot == null) { throw new ArgumentNullException(); } if (unitOfWorkScopeProvider == null) { throw new ArgumentNullException(); } #endregion // Arguments _syncRoot = syncRoot; _unitOfWorkScopeProvider = unitOfWorkScopeProvider; }
public LockUnitOfWorkScope(object syncRoot, IUnitOfWorkScopeProvider unitOfWorkScopeProvider) { #region Contracts if (syncRoot == null) { throw new ArgumentNullException(); } if (unitOfWorkScopeProvider == null) { throw new ArgumentNullException(); } #endregion // Arguments _syncRoot = syncRoot; // Enter try { // Monitor Monitor.Enter(_syncRoot); // UnitOfWorkScope _unitOfWorkScope = unitOfWorkScopeProvider.Create(); if (_unitOfWorkScope == null) { throw new InvalidOperationException(); } } catch { // Dispose this.Dispose(); // Throw throw; } }
// Constructors public LockUnitOfWorkScopeProvider(IUnitOfWorkScopeProvider unitOfWorkScopeProvider) : this(new object(), unitOfWorkScopeProvider) { }