public static PriceModel Sum <T>(this IEnumerable <T> items, Func <T, PriceModel> price) { var total = PriceModel.Zero(); return(items.Aggregate(total, (current, item) => current + price(item))); }