Given either of the variables below, how can I 'inspect' them to obtain the parameter value passed in? i.e. 12345.
System.Func<DateTime> f1 = () => DateTime.Now.AddDays(12345);
System.Linq.Expressions.Expression<System.Func<DateTime>>
f2 = () => DateTime.Now.AddDays(12345);
Edit:
The two answers below by Mikael and Kirk both answer my orignal question. However, I've now made this a little more complex to deal with 'real life'. Ideally I'm looking for a 'general' solution, which will work with something alongs the lines of the below:
var days = 123;
var hours = 456;
System.Func<DateTime> f1 = () => DateTime.Now.AddDays(days).AddHours(hours);
Expression<System.Func<DateTime>> f2 = () => DateTime.Now.AddDays(days).AddHours(hours);
What I'm really after is a way to generate a unikey 'key' given a lamda expression. My idea is to use the method name, and the parameter name/value pairs, but I'm welcome to other suggestions! Thanks.