title: How to get value of constantexpression
body: <p>I'm trying to evaluate the value of a constant expression. In the debugger I can see the value:</p>
  <p><img src="https://i.stack.imgur.com/rNNRk.png" alt="watch" /></p>
  <p>but how do I get at it in code?</p>
  <p>The expression is of the form:</p>
  <pre><code>x =&gt; x.ListPropery[5].ChildProperty
  </code></pre>
  <p>I'm walking down the expression to convert it into a string, but I've got stuck at the indexer part.</p>
  <p>The indexer creates a <code>MethodCallExpression</code> on <code>IList&lt;&gt;</code> to <code>get_Item</code>, I can then work my way into the arguments to get at a constant expression which was generated like this:</p>
  <pre><code>for(var i = 0; i &lt; list.Count; i++)
  {
      var j = i;
      Expression&lt;Func&lt;IList&lt;TValue&gt;, TValue&gt;&gt; indexer = xs =&gt; xs[j];
  </code></pre>
  <p>Update:</p>
  <pre><code>(exp.Arguments[0] as MemberExpression).Member
  </code></pre>
  <p>returns a <code>MemberInfo</code></p>