I want to filter an
IEnumerable<ModuleItem> by an Where calls defined by the user (so the expression is given by a String object)
So far I am able to create my filters with DynamicLinq with this code
Expression<Func<ModuleItem, bool>> expr = System.Linq.Dynamic.DynamicExpression.ParseLambda<ModuleItem, bool>(value, null);
The problem is that the overall filtering will fail if the evaluation fails for an item in the collection. So I would like to catch the exception within the lambda and return false instead to filter out the failing item.
I tried wrapping the expression with
TryExpression.TryCatch(...) but I cannot get back an
How can I wrap my dynamic expression and get back an
Expression<Func<ModuleItem, bool>> object to use as the Where argument ?