// creates new designer with arguments (safe) internal static NameChainer GetNewDesigner( string name, bool isEmbeddedTransaction, bool isEmbeddedTryCatch, Designer.IsolationLevel isolationLevel = IsolationLevel.Default) { var root = new InternalRoot(isEmbeddedTransaction); root.IsEmbeddedTryCatch = isEmbeddedTryCatch; root.Name = name; return(new NameChainer(root, isolationLevel)); }
internal SetIsolationLevelChainer(Chainer prev, Designer.IsolationLevel isolationLevel) : base(prev) { Build = (buildContext, buildArgs) => { string isolation = isolationLevel.ToSql(); return(Text.GenerateSql(50) .NewLine(Text.SetTransactionIsolationLevel).S() .Append(isolation) .Terminate() .ToString()); }; }
internal NameChainer(Chainer prev, Designer.IsolationLevel embeddedTransactionIsolationLevel = Designer.IsolationLevel.Default) : base(prev) { // check root reuse var root = prev.GetRoot(); if (root.IsUsed) { if (root.Node != null && root.Node.IsUsed) { throw new QueryTalkException("NameChainer.ctor", QueryTalkExceptionType.RootReuseDisallowed, String.Format("root = {0}", root.Name)); } root.ClearForReuse(); } root.SetAsUsed(); root.EmbeddedTransactionIsolationLevel = embeddedTransactionIsolationLevel; }
/// <summary> /// Controls the locking and row versioning behavior of Transact-SQL statements issued by a connection to SQL Server. /// </summary> /// <param name="prev">A predecessor object.</param> /// <param name="isolationLevel">A type of the isolation level.</param> public static SetIsolationLevelChainer SetIsolationLevel(this IAny prev, Designer.IsolationLevel isolationLevel) { return(new SetIsolationLevelChainer((Chainer)prev, isolationLevel)); }