public static double Product <T1>(this IEnumerable <T1> set1, Func <T1, int, double> func) { var total = 0d; set1.Enumerate((item, index) => { total *= func(item, index); }); return(total); }