get methodinfo from a method reference C#

Slight adaptation of a previously posted answer, but this blog post seems to achieve what you’re asking for; http://blog.functionalfun.net/2009/10/getting-methodinfo-of-generic-method.html

Sample usage would be as follows;

var methodInfo = SymbolExtensions.GetMethodInfo(() => Program.Main());

Original answer was to this question; https://stackoverflow.com/a/9132588/5827

Leave a Comment