title: How to cast expression in c#
body: <p>I am having expression </p>
  
  <pre><code>Expression&lt;Func&lt;TSource, string&gt;&gt; 
  </code></pre>
  
  <p>I am cast it to  <code>Expression&lt;Func&lt;TSource, object&gt;&gt;</code> </p>
  
  <p>using as </p>
  
  <pre><code>As Expression&lt;Func&lt;TSource, object&gt;&gt;
  </code></pre>
  
  <p>But gives me null every time .</p>
  
  <p>as string is reference type so it should not do so.</p>
  
  <p>even <code>Expression&lt;Func&lt;TSource, MyClass&gt;&gt;</code> this expression also gives null on conversion.</p>