public AggregateResult Parse(IEnumerable <AggregateAttribute> header) { NodeTree nodeTree = NodeParser.Parse(this.Schema, header); Node valueNode = nodeTree.Items.FirstOrDefault(this.IsResultNode); Node itemNode = nodeTree.Items.FirstOrDefault(this.IsResultListNode); AggregateResult result = new AggregateResult(this.Schema); if (itemNode != null) { result.Value = this.CreateReader(result, itemNode); result.Target = new AggregateTarget() { AddMethod = itemNode.Metadata.Parent.Composition.Add, NewList = itemNode.Metadata.Parent.Composition.Construct, }; } else { result.Value = this.CreateReader(result, valueNode); } return(result); }
public ListResult Parse(IEnumerable <ColumnAttribute> header) { NodeTree nodeTree = NodeParser.Parse(this.Schema, header); ListResult result = new ListResult(this.Schema, this.QueryType); this.AddWriters(result, nodeTree); this.AddAggregates(result, nodeTree); return(result); }
public EnumerateResult Parse(IEnumerable <ColumnAttribute> header) { NodeTree nodeTree = NodeParser.Parse(this.Schema, header); Node valueNode = nodeTree.Items.FirstOrDefault(this.IsResultNode); Node listNode = nodeTree.Items.FirstOrDefault(this.IsResultListNode); EnumerateResult result = new EnumerateResult(this.Schema); result.Value = this.CreateReader(result, listNode ?? valueNode); return(result); }