You could certainly build the expression dynamically, but I would consider using Dynamic LINQ as an alternative first, though you may not be able to use Contains. In addition, you may want to consider using PredicateBuilder to build complex queries additively.
More Related Contents:
- lambda expression to sort on min values in a group
- Is there a reason for C#’s reuse of the variable in a foreach?
- Getting all types that implement an interface
- C# Lambda expressions: Why should I use them?
- convert a list of objects from one type to another using lambda expression
- Sorting a list using Lambda/Linq to objects
- Are Lambda expressions in C# closures?
- Cannot use ref or out parameter in lambda expressions
- C# Lambda ( => ) [duplicate]
- Visual Studio debugging “quick watch” tool and lambda expressions
- Can I specify my explicit type comparator inline?
- Wrapping StopWatch timing with a delegate or lambda?
- How do I create an expression tree to represent ‘String.Contains(“term”)’ in C#?
- How do I pronounce “=>” as used in lambda expressions in .Net [closed]
- I want to understand the lambda expression in @Html.DisplayFor(modelItem => item.FirstName)
- Entity Framework Filter “Expression”
- lambda expressions in immediate window for VS2015
- Is it Linq or Lambda?
- Proper Currying in C#
- Expression of type ‘System.Int32’ cannot be used for return type ‘System.Object’
- Fastest way to Remove Duplicate Value from a list by lambda
- Peculiar overload resolution with while (true)
- Local variable and expression trees
- How to cast Expression to Expression
- convert this LINQ expression into Lambda
- List complex sorting
- How can I capture the value of an outer variable inside a lambda expression?
- How do I dynamically create an Expression predicate?
- How to use Expression Tree to safely access path of nullable objects?
- How do I translate an expression tree of one type to a different expression type?