コード例 #1
0
        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());
        }
コード例 #2
0
 public override void Step(T container, string selector)
 {
     _counter.Step(container, selector);
     _summator.Step(container, selector);
 }
コード例 #3
0
 public override void Step(T container, string selector)
 {
     _countAggregator.Step(container, AnonType.IndexToField(1 + AnonType.FieldToIndex(selector)));
     _valueAggregator.Step(container, selector);
 }