I'm trying to build dynamically build an expression LINQ function, when I do string comparison for datetime I get ToString
method with format argument:
else if (member.Type == typeof(DateTime))
{
var toString = typeof(DateTime).GetMethod("ToString", new Type[] { typeof(string) });
member = Expression.Call(member, toString, Expression.Constant("yyyyMMdd"));
}
I need to get ToString
format method of DateTime?
.