Working with nullable types in Expression Trees
问题 I have an extension method to dynamically filter Linq to Entities results using string values. It works fine until I use it to filter nullable columns. Here's my code: public static IOrderedQueryable<T> OrderingHelperWhere<T>(this IQueryable<T> source, string columnName, object value) { ParameterExpression table = Expression.Parameter(typeof(T), ""); Expression column = Expression.PropertyOrField(table, columnName); Expression where = Expression.GreaterThanOrEqual(column, Expression.Constant