protected override object ExtractAggregateValue(AggregationState aggregationState)
 {
     if (aggregationState.ContainsKey("found"))
     {
         return(aggregationState.DataItem);
     }
     return(null);
 }
Exemple #2
0
        protected override void AggregateValue(object value, AggregationState aggregationState, object[] args)
        {
            if (!aggregationState.ContainsKey("results"))
            {
                aggregationState["results"] = new List <object>();
            }

            var pass = TypeNormalizer.EnsureType <bool>(value);

            if (pass && aggregationState.DataItem != null)
            {
                aggregationState.GetValue <List <object> >("results").Add(aggregationState.DataItem);
            }
        }
Exemple #3
0
        protected override void AggregateValue(object value, AggregationState aggregationState, params object[] args)
        {
            var val = TypeNormalizer.EnsureType <double>(value);

            if (!aggregationState.ContainsKey("value"))
            {
                aggregationState["value"] = val;
            }
            else
            {
                var min = aggregationState.GetValue <double>("value");

                if (val < min)
                {
                    min = val;
                }

                aggregationState["value"] = min;
            }
        }