@@ -1813,22 +1813,42 @@ public virtual string BuildBatch(string[] statements)
18131813 var expectedLength = BatchBegin . Length + BatchEnd . Length +
18141814 statements . Sum ( statement => statement . Length + statementEndingLength ) ;
18151815 var builder = new StringBuilder ( expectedLength ) ;
1816+ Console . WriteLine ( "BuildBatch(string[] statements) Begin" ) ;
18161817 builder . Append ( BatchBegin ) ;
18171818 foreach ( var statement in statements ) {
1818- var actualStatement = statement
1819- . TryCutPrefix ( BatchBegin )
1820- . TryCutSuffix ( BatchEnd )
1821- . TryCutSuffix ( NewLine )
1822- . TryCutSuffix ( BatchItemDelimiter )
1823- . Trim ( ) ;
1819+ Console . WriteLine ( "BuildBatch(string[] statements) ITERATION Begin" ) ;
1820+ Console . WriteLine ( $ "Raw statement { statement } ") ;
1821+ var noBatchBeginStatement = statement . TryCutPrefix ( BatchBegin ) ;
1822+ Console . WriteLine ( $ "No BatchBegin statement { noBatchBeginStatement } ") ;
1823+ var noBatchEndStatement = noBatchBeginStatement . TryCutSuffix ( BatchEnd ) ;
1824+ Console . WriteLine ( $ "No BatchEnd statement { noBatchEndStatement } ") ;
1825+ var noNewLineStatement = noBatchEndStatement . TryCutSuffix ( NewLine ) ;
1826+ Console . WriteLine ( $ "No NewLine statement { noNewLineStatement } ") ;
1827+ var noBatchDeliminterStatement = noNewLineStatement . TryCutSuffix ( BatchItemDelimiter ) ;
1828+ Console . WriteLine ( $ "No BatchDelimiter statement { noBatchDeliminterStatement } ") ;
1829+ var actualStatement = noBatchDeliminterStatement . Trim ( ) ;
1830+ //var actualStatement = statement
1831+ // .TryCutPrefix(BatchBegin)
1832+ // .TryCutSuffix(BatchEnd)
1833+ // .TryCutSuffix(NewLine)
1834+ // .TryCutSuffix(BatchItemDelimiter)
1835+ // .Trim();
18241836 if ( actualStatement . Length == 0 )
18251837 continue ;
18261838 builder . Append ( actualStatement ) ;
1839+ Console . WriteLine ( "Add BatchItemDelimiter in iteration of statements in BuildBatch(string[] statements)" ) ;
18271840 builder . Append ( BatchItemDelimiter ) ;
18281841 builder . Append ( NewLine ) ;
1842+
1843+ Console . WriteLine ( "BuildBatch(string[] statements) ITERATION End" ) ;
18291844 }
18301845 builder . Append ( BatchEnd ) ;
1831- return builder . ToString ( ) ;
1846+ //return builder.ToString();
1847+ var result = builder . ToString ( ) ;
1848+
1849+ Console . WriteLine ( ) ;
1850+ Console . WriteLine ( "BuildBatch(string[] statements) End" ) ;
1851+ return result ;
18321852 }
18331853
18341854 public virtual string TranslateSortOrder ( bool ascending )
0 commit comments