I suspect this is more simple than I think!
I can create a list of Func and then add to it
var x = new List<Func<IBQCustomer, string>>();
x.Add(c => c.FullName);
Bu how to I add an extra parameter into the Func? When I try I get an error
var y = new List<Func<IBQCustomer, OrderByDirection, string>>();
y.Add(...);
Is this possible?
I am aiming to build up a list of properties and what to do with them
Error:
y.Add(c => c.FullName, OrderByDirection.Asc);
No overload for Add that takes 2 arguments
‘OrderByDirection’ enumeration is not a function argument? In this case you could use something like:
Of course you could also use a custom class instead of ‘Tuple<>’:
Or are you maybe writing the lambda expression wrong? This should work: