Can we modify this code to return the name of a method instead of a property?
<p>Looking for a clean way to discover the string name of a method in a type safe way.</p>

<p>Here is what I have for properties, but I'm having trouble figuring out how to do it for methods.</p>

<pre><code>class Program
{
    class Customer
    {
        public String Id { get; set; }
    }

    public static String GetPropertyName&lt;T&gt;(Expression&lt;Func&lt;T, Object&gt;&gt; selector) where T : class
    {
        var expression = (MemberExpression)selector.Body;
        return expression.Member.Name;
    }

    static void Main(string[] args)
    {
        String propertyName = GetPropertyName&lt;Customer&gt;(c =&gt; c.Id);
    }
}
</code></pre>
