title: Creating lambda expression ConstantExpression with a string value
body: <p>I want to create lambda expression providing property name, a value (as string) and property type (as Type). </p>
  
  <p>The problem with that is in line <code>Expression.Constant(value1, propertyType);</code><br>
  value1 that is passed to Foo is string. and must be parsed to "unknown" type</p>
  
  <pre><code>static Expression&lt;Func&lt;T, bool&gt;&gt; LabmdaExpression&lt;T&gt;(string property1, string value1, 
                                                       Type propertyType)
  {                              
      var parameterExpression = Expression.Parameter(typeof(TheObject), "o");
      var memberExpression1 = Expression.PropertyOrField(parameterExpression, property1);
  
      //casting?
      var valueExpression1 = Expression.Constant(value1, propertyType);
  
      var binaryExpression1 = Expression.GreaterThan(memberExpression1, valueExpression1);
      return Expression.Lambda&lt;Func&lt;T, bool&gt;&gt;(binaryExpression1, parameterExpression);
  }
  </code></pre>