I\'ve an object that represent a business data.
Basically, it\'s an object agregating some totals:
public class MyClass{ public double MyDataOne {
Write your own extension method:
public static MyClass Sum(this IEnumerable source) { var result = new MyClass(); // all data will be zeros foreach(var item in source) result = result + item; return result; }
Usage:
var sum = myClasses.Sum();