public void SelectParse1() { XElement el = XElement.Parse(@"<f>select [System.Id], [Phoenix.DueDate], [Phoenix.MagicDueDate], [System.WorkItemType], [System.State], [System.Title], [System.IterationPath] from WorkItems where ([System.State] = 'New' or [System.State] = 'Active') and ([System.AssignedTo] = 'Ventsislav Mladenov' or [System.TeamProject] = @project) order by [System.Id]</f>"); var parser = new LexalParser(el.Value); var nodes = parser.ProcessSelect(); Console.WriteLine(nodes); Assert.AreEqual("[System.Id], [Phoenix.DueDate], [Phoenix.MagicDueDate], [System.WorkItemType], [System.State], [System.Title], [System.IterationPath]", nodes.ToString()); }
public List<string> GetSelectColumns() { var parser = new LexalParser(this.QueryText); return parser.ProcessSelect().Select(x => x.ColumnName).ToList(); }