private void EndAttach(AttachTransaction transaction) { lock (_attachTransactionsLocker) { if (this._attachTransactions.Remove(transaction)) { if (this._attachTransactions.Count == 0) { this._attachTransactionsSignal.Set(); } } } }
private AttachTransaction BeginAttach <T>() where T : class { ////if (ObjectManagerScope.Current == null) ////{ this._entityTransactionsSignal.WaitOne(); ////} var transaction = new AttachTransaction(this); lock (_attachTransactionsLocker) { this._attachTransactions.Add(transaction, DateTime.Now); this._attachTransactionsSignal.Reset(); } return(transaction); }