(source: scottgu.com)
You need something like this? Use the Linq Dynamic Query Library (download includes examples).
Check out ScottGu’s blog for more examples.
More Related Contents:
- System.Linq.Expression.Compile error
- Dynamic where clause (OR) in Linq to Entities
- How to specify dynamic field names in a Linq where clause?
- Linq access property by variable
- How to have nested query with LINQ
- LEFT OUTER JOIN in LINQ
- Check whether an array is a subset of another
- Order of LINQ extension methods does not affect performance?
- Where IN clause in LINQ [duplicate]
- Deserialize XML To Object using Dynamic
- Query an XDocument for elements by name at any depth
- A specified Include path is not valid. The EntityType does not declare a navigation property with the name *
- Why does a method invocation expression have type dynamic even when there is only one possible return type?
- LINQ, Where() vs FindAll()
- Swap two items in List
- How do I get the index of the highest value in an array using LINQ?
- Exception using CopyToDataTable with “new {..}” LINQ query
- How to group by on 2 child entities and get total of both this child entities?
- Custom Method in LINQ to SQL query
- What does this C# code with an “arrow” (=>, an equal sign and greater than sign) mean and how is it called?
- Using Linq Except not Working as I Thought
- What is the purpose of AsQueryable()?
- Calling a SQL User-defined function in a LINQ query
- How to search Hierarchical Data with Linq
- How to set property value using Expressions? [duplicate]
- Should the order of LINQ query clauses affect Entity Framework performance?
- Transform IEnumerable asynchronously by awaiting each task
- Map two lists into a dictionary in C#
- How to check if all list items have the same value and return it, or return an “otherValue” if they don’t?
- Can I use Linq’s Except() with a lambda expression comparer?