Exemplo n.º 1
0
        public ResultSet.ResultSet Apply(ResultSet.ResultSet rs)
        {
            var newRs  = rs.Clone();
            var groups = groupBy.Execute(rs);

            foreach (var group in groups)
            {
                var groupRs = new ResultSet.ResultSet();
                groupRs.Load(group.Value);
                var filtered = filter.Apply(groupRs);
                newRs.AddRange(filtered.Rows.Cast <DataRow>());
            }
            return(newRs);
        }
Exemplo n.º 2
0
        public ResultSet.ResultSet Apply(ResultSet.ResultSet rs)
        {
            IList <ScoredObject> subset = new List <ScoredObject>();
            var scorer = new DataRowScorer(Operand, Aliases, Expressions);

            foreach (DataRow row in rs.Rows)
            {
                var score = scorer.Execute(row);
                InsertRow(score, ref subset);
            }

            var newRs = rs.Clone();

            newRs.Load(subset.Select(x => x.Value as DataRow));
            return(newRs);
        }