v0.4.1
Fixes
-
SearchPredicate
,ColumnSearchPredicate
andGlobalSearchPredicate
now work with nested expressions where the parameter replacement of the search value did not work properly before.Example which didn't work but works now:
SearchPredicate = (p, s) => p.EmailAddresses.Any(e => e.Address.Contains(s))
Before the fix, the parameters
has not been replaced in the inner expressione => e.Address.Contains(s)
properly. Now, instead of replacing the parameter, we simply wrap the expression in another expression and pass the search value as constant to the inner expression:var entityParam = expr.Parameters.Single(p => p.Type == typeof(TEntity)); var searchValueConstant = Expression.Constant(searchValue); expr = (Expression<Func<TEntity, bool>>)Expression.Lambda( Expression.Invoke(expr, entityParam, searchValueConstant), entityParam);