public FakedTransaction(ICoreTransaction parent) { if (parent != null && parent.IsRolledback != null) { throw new InvalidOperationException("The transaction can not be created because a parent transaction is rolled back. Exception:\r\n\t" + parent.IsRolledback.Message, parent.IsRolledback); } this.parent = parent; }
public NamedTransaction(ICoreTransaction parent, string savePointName) { if (parent == null) { throw new InvalidOperationException("Named transactions should be nested inside another transaction"); } if (parent != null && parent.IsRolledback != null) { throw new InvalidOperationException("The transaction can not be created because a parent transaction is rolled back. Exception:\r\n\t" + parent.IsRolledback.Message, parent.IsRolledback); } this.parent = parent; this.savePointName = savePointName; }
Transaction(Func <ICoreTransaction?, ICoreTransaction> factory) { var dic = currents.Value ??= new Dictionary <Connector, ICoreTransaction>(); Connector bc = Connector.Current; if (bc == null) { throw new InvalidOperationException("ConnectionScope.Current not established. Use ConnectionScope.Default to set it."); } ICoreTransaction?parent = dic.TryGetC(bc); dic[bc] = coreTransaction = factory(parent); }
Transaction(Func <ICoreTransaction, ICoreTransaction> factory) { if (currents.Value == null) { currents.Value = new Dictionary <Connector, ICoreTransaction>(); } Connector bc = Connector.Current; if (bc == null) { throw new InvalidOperationException("ConnectionScope.Current not established. Use ConnectionScope.Default to set it."); } ICoreTransaction parent = currents.Value.TryGetC(bc); currents.Value[bc] = coreTransaction = factory(parent); }
public TestTransaction(ICoreTransaction parent, IsolationLevel?isolation) : base(parent, isolation) { oldTestTransaction = inTestTransaction.Value; inTestTransaction.Value = true; }
public NoneTransaction(ICoreTransaction parent) { this.parent = parent; }
public RealTransaction(ICoreTransaction parent, IsolationLevel?isolationLevel) { IsolationLevel = isolationLevel; this.parent = parent; }