Is is possible to scan a function provided as a lamba expression to figure out the nature of the function at runtime?
Example:
class Program
{
static void Main(string[] args)
{
Examples example = new Examples(x => x ^ 2 + 2);
}
}
public class Examples
{
public Examples(Func<dynamic, dynamic> func)
{
// How can I scan "func" here to figure out that it is defined as "x => x ^ 2 + 2" instead of, say, as "x => Math.Exp(x)"?
}
}