title: C# lambda body to string
body: <p>I have the following lambda expression</p>
  
  <pre><code>    var expr = a =&gt; (a.Name == "Alex" &amp;&amp; a.DateCreated &lt; DateTime.Now.AddHours(2))
  </code></pre>
  
  <p>I want to get the expression body with runtime values in a string, if i call expr.Body.ToString() i get the following string in return.</p>
  
  <pre><code>    {((a.Name == "Alex") AndAlso (a.DateCreated &lt; DateTime.Now.AddHours(2)))}
  </code></pre>
  
  <p>So just to clarify i expected to get the value of DateTime.Now.AddHours(2). I been spending the last couple of nights searching the web furiously without any results. This may be down to   me not knowing what to search for. Hope you guys will be able to help :)</p>