title: Convert Expression<Func<T, TProperty>> to Expression<Func<object, object>> and vice versa
body: <p>Is there a way to convert the property selector <code>Expression&lt;Func&lt;T, TProperty&gt;&gt;</code> to <code>Expression&lt;Func&lt;object, object&gt;&gt;</code> and vice versa? I already know how to convert to <code>Expression&lt;Func&lt;T, object&gt;&gt;</code> using...</p>
  
  <pre><code>Expression&lt;Func&lt;T, TProperty&gt;&gt; oldExp;
  Expression.Lambda&lt;Func&lt;T, object&gt;&gt;(Expression.Convert(oldExp.Body, typeof(object)), oldExp.Parameters);
  </code></pre>
  
  <p>... but I need to effectively cast both, the argument and the result of the function, not just e.g replace them with a <code>ExpressionVisitor</code> because they need to be casted back later.</p>