Пример #1
0
 internal virtual SqlBlock VisitBlock(SqlBlock b)
 {
     for (int i = 0, n = b.Statements.Count; i < n; i++)
     {
         b.Statements[i] = (SqlStatement)this.Visit(b.Statements[i]);
     }
     return(b);
 }
            internal override SqlBlock VisitBlock(SqlBlock block)
            {
                SqlBlock nb = new SqlBlock(block.SourceExpression);

                foreach (SqlStatement stmt in block.Statements)
                {
                    nb.Statements.Add((SqlStatement)this.Visit(stmt));
                }
                return(nb);
            }
Пример #3
0
            internal override SqlBlock VisitBlock(SqlBlock block)
            {
                var sqlBlock = new SqlBlock(block.SourceExpression);

                foreach (var statement in block.Statements)
                {
                    sqlBlock.Statements.Add((SqlStatement)Visit(statement));
                }
                return(sqlBlock);
            }
Пример #4
0
        internal ReadOnlyCollection <ReadOnlyCollection <SqlParameterInfo> > ParameterizeBlock(SqlBlock block)
        {
            SqlParameterInfo rowStatus =
                new SqlParameterInfo(
                    new SqlParameter(typeof(int), typeProvider.From(typeof(int)), "@ROWCOUNT", block.SourceExpression)
                    );
            List <ReadOnlyCollection <SqlParameterInfo> > list = new List <ReadOnlyCollection <SqlParameterInfo> >();

            for (int i = 0, n = block.Statements.Count; i < n; i++)
            {
                SqlNode statement = block.Statements[i];
                List <SqlParameterInfo> parameters = this.ParameterizeInternal(statement);
                if (i > 0)
                {
                    parameters.Add(rowStatus);
                }
                list.Add(parameters.AsReadOnly());
            }
            return(list.AsReadOnly());
        }