Exemplo n.º 1
0
        public static IEnumerable <TSqlFragment> Flatten(this TSqlFragment fragment)
        {
            var nodes = new List <TSqlFragment>();

            SQLDynamicVisitor.Default(node => nodes.Add(node)).Visit(fragment);
            return(nodes);
        }
Exemplo n.º 2
0
        public static bool ContainsAggregate(this TSqlFragment fragment)
        {
            bool aggregate = false;

            //TODO:in the case of a subquery i should not look into it.
            SQLDynamicVisitor.Default(node => { })
            .ForType <FunctionCall>(fc =>
            {
                if (fc.FunctionName.Value.Equals("COUNT", StringComparison.InvariantCultureIgnoreCase))
                {
                    aggregate = true;
                }
            })
            .Visit(fragment);
            return(aggregate);
        }
Exemplo n.º 3
0
 public SQLInternalVisitor(SQLDynamicVisitor outer)
 {
     this.outer = outer;
 }