public static ReadOnlyCollection <QueryCommand> Gather(Expression expression) { var gatherer = new CommandGatherer(); gatherer.Visit(expression); return(gatherer.commands.AsReadOnly()); }
public override string GetQueryText(Expression expression) { Expression plan = this.GetExecutionPlan(expression); var commands = CommandGatherer.Gather(plan).Select(c => c.CommandText).ToArray(); return(string.Join("\n\n", commands)); }