protected override void AggregateValue(object value, AggregationState aggregationState, params object[] args) { var sum = aggregationState.GetValue <double>("value"); var nextVal = TypeNormalizer.EnsureType <double>(value); aggregationState["value"] = sum + nextVal; }
protected override void AggregateValue(object value, AggregationState aggregationState, params object[] args) { bool val = TypeNormalizer.EnsureType<bool>(value); if (val) { var count = aggregationState.GetValue<int>("count"); aggregationState["count"] = count + 1; } }
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); } }
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; } }
protected override double ExtractAggregateValue(AggregationState aggregationState) { return(aggregationState.GetValue <double>("value")); }
protected override bool ExtractAggregateValue(AggregationState aggregationState) { return(aggregationState.GetValue <bool>("value")); }
protected override int ExtractAggregateValue(AggregationState aggregationState) { return aggregationState.GetValue<int>("count"); }
protected override IList <object> ExtractAggregateValue(AggregationState aggregationState) { return(aggregationState.GetValue <List <object> >("results")); }