예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }