main
1namespace domain
2{
3 using System.Collections.Generic;
4
5 public static class Summation
6 {
7 static public IQuantity Sum<T>(this IEnumerable<IQuantity> items) where T: IUnitOfMeasure,new()
8 {
9 var result = 0m.ToQuantity<T>();
10 foreach (var item in items) {
11 result = result.Plus(item);
12 }
13 return result;
14 }
15 }
16}