I have been looking for any tip or idea about to Compute Enumerables using a String Expression, I mean by compute to execute operations like Min, Max, Average and Sum.
I am looking for something like This..
// PARAMETER MODEL
public class Parameter
{
public string Name { get; set; }
public double Price1 { get; set; }
public double Price2 { get; set; }
public double Price3 { get; set; }
public double Price4 { get; set; }
}
// GETS AN ENUMERABLE COLLECTION OF PARAMETERS
IEnumerable<Parameter> currentParameters = ParameterCreator.GetParameters();
// HERE IS MY QUESTION
double maxPrice = currentParameters.Compute("MAX[Price2]");
Where Price2 String Expressions indicates a property in Parameter Class. MAX a Compute through Price2 parameter on the Enumerable Collection. And Compute, a dummy extension method on any package or framework.
Does anyone has any idea whether there is any package, framework or anything to achieve this?
Thank you for your help.