public static object Calculate <T>(IEnumerable <T> source, Func <T, object> selector) { var summator = new SumAggregator <object>(new IdentityAccessor()); foreach (var i in source.Select(selector)) { summator.Step(i, null); } return(summator.Finish()); }
public override void Step(T container, string selector) { _counter.Step(container, selector); _summator.Step(container, selector); }
public override void Step(T container, string selector) { _countAggregator.Step(container, AnonType.IndexToField(1 + AnonType.FieldToIndex(selector))); _valueAggregator.Step(container, selector); }