title: Access the value of a member expression
body: <p>If i have a product.</p>
  
  <pre><code>var p = new Product { Price = 30 };
  </code></pre>
  
  <p>and i have the following linq query.</p>
  
  <pre><code>var q = repo.Products().Where(x=&gt;x.Price == p.Price).ToList()
  </code></pre>
  
  <p>In an IQueryable provider, I get a MemberExpression back for the p.Price which contains a Constant Expression, however I can't seem to get the value "30" back from it.</p>
  
  <p><strong>Update</strong>
  I have tried this but it doesn't seem to work.</p>
  
  <pre><code>var memberExpression = (MemberExpression)GetRootConstantExpression(m);
  var fi = (PropertyInfo)memberExpression.Member;
  var val = fi.GetValue(((ConstantExpression)memberExpression.Expression).Value, null);
  </code></pre>
  
  <p>Cheers.</p>