private void MarkOpened() { if (Interlocked.CompareExchange(ref _opened, 1, 0) != 0) { throw ExecutionContextException.ConnectionAlreadyOpen(); } }
public IContextBuilder UseTransaction(IsolationLevel il) { if (IsOpen) { throw ExecutionContextException.ConnectionAlreadyOpen(); } _isolationLevel = il; return(this); }