/// <summary> /// Use this constructor to control the tgTransactionScopeOption as it applies /// to this transaction. /// <code> /// using (tgTransactionScope scope = new /// tgTransactionScope(tgTransactionScopeOption.RequiresNew, IsolationLevel.ReadCommitted)) /// { /// // Do your work here /// scope.Complete(); /// } /// </code> /// </summary> /// <param name="option">See <see cref="tgTransactionScopeOption"/></param> /// <param name="level">See IsolationLevel in the System.Data namespace</param> public tgTransactionScope(tgTransactionScopeOption option, IsolationLevel level) { this.option = option; this.level = level; CommonInit(this); this.root.count++; }
/// <summary> /// Use this constructor to control the tgTransactionScopeOption as it applies /// to this transaction. /// <code> /// using (tgTransactionScope scope = new tgTransactionScope(tgTransactionScopeOption.RequiresNew)) /// { /// // Do your work here /// scope.Complete(); /// } /// </code> /// </summary> /// <param name="option">See <see cref="tgTransactionScopeOption"/></param> public tgTransactionScope(tgTransactionScopeOption option) { if (option == tgTransactionScopeOption.None) { throw new ArgumentException("'None' cannot be passed"); } this.option = option; this.level = tgTransactionScope.IsolationLevel; CommonInit(this); this.root.count++; }
/// <summary> /// Use this constructor to control the tgTransactionScopeOption as it applies /// to this transaction. /// <code> /// using (tgTransactionScope scope = new tgTransactionScope(tgTransactionScopeOption.RequiresNew)) /// { /// // Do your work here /// scope.Complete(); /// } /// </code> /// </summary> /// <param name="option">See <see cref="tgTransactionScopeOption"/></param> public tgTransactionScope(tgTransactionScopeOption option) { if (option == tgTransactionScopeOption.None) throw new ArgumentException("'None' cannot be passed"); this.option = option; this.level = tgTransactionScope.IsolationLevel; CommonInit(this); this.root.count++; }
/// <summary> /// The default constructor, this transactions <see cref="tgTransactionScopeOption"/> will be /// set to Required. The IsolationLevel is set to Unspecified. /// <code> /// using (tgTransactionScope scope = new tgTransactionScope()) /// { /// // Do your work here /// scope.Complete(); /// } /// </code> /// </summary> public tgTransactionScope() { this.option = tgTransactionScopeOption.Required; this.level = tgTransactionScope.IsolationLevel; CommonInit(this); this.root.count++; }