public static double Somase <T>(IEnumerable <T> lista, LambdaExpressionFunc <T, bool> filtro, LambdaExpressionFunc <T, double> selector) { return(lista.Where(i => filtro.EvalLambda(i)).Sum(i => selector.EvalLambda(i))); }
public static double Media <T>(IEnumerable <T> lista, LambdaExpressionFunc <T, double> selector) { return(lista.Average(i => selector.EvalLambda(i))); }
public static IEnumerable <TOut> Seleciona <T, TOut>(IEnumerable <T> lista, LambdaExpressionFunc <T, TOut> selector) { return(lista.Select(i => selector.EvalLambda(i))); }
public static IEnumerable <T> Filtra <T>(IEnumerable <T> lista, LambdaExpressionFunc <T, bool> filtro) { return(lista.Where(i => filtro.EvalLambda(i))); }