title: Expression.Constant(value, type) type is unknown. How to define the type
body: <p>So the problem is 
  I have the following line wehre <strong>value</strong> is a string</p>
  
  <pre>
  var filterValue = Expression.Constant(value, property.Type);
  </pre>
  
  <p>if property.Type is a string everything is fine however the type really could be anything, like a <strong>decimal?</strong></p>
  
  <p>I dont know how to make this work for all different types
  I have this function</p>
  
  <pre>
  private static T Parse (string value)
  {
      return (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromString(value);
  }
  </pre>
  
  <p>using that I can do this:</p>
  
  <pre>
  var newValue = Parse(value);
  var filterValue = Expression.Constant(newValue, property.Type);
  </pre>
  
  <p>however I would have to know in advance the type , I tried</p>
  
  <pre>
  var newValue = Parse(value);
  </pre>
  
  <p>but that doesnt work</p>
  
  <p>Any ideas?</p>