I want to pass a condition as Action to another method. First line in "ComputerPriceGenerator" works, but how to make the array work (second line)?.. Any ideas
I'm looking for advice..., CalculateAllPrice is not designed yet
public void ComputerPriceGenerator()
{
//Below line Works
PriceMachine.CalculatePrice(cart.Computers[0],() => ComputerConverter(cart.Computers[0]));
//How to make this work, i don't want to loop it???
PriceMachine.CalculateAllPrice(cart.Computers,() => ComputerConverter(??));
}
public void ComputerConverter(Computer comp)
{
if (comp.Memory <= 2)
comp.Discount = 10;
}
CalculateAllPriceshould be. I could be wrong, though.