You’re probably looking for something like Predicate Builder which allows you to control the AND’s and OR’s of the where statement easier.
There’s also Dynamic Linq which allows you to submit the WHERE clause like a SQL string and it will parse it into the correct predicate for a WHERE.
Related Contents:
- Dynamic where clause (OR) in Linq to Entities
- How to create LINQ Expression Tree to select an anonymous type
- ‘Contains()’ workaround using Linq to Entities?
- Bulk-deleting in LINQ to Entities
- The type of one of the expressions in the join clause is incorrect in Entity Framework
- Entity framework left join
- Writing Recursive CTE using Entity Framework Fluent syntax or Inline syntax
- LEFT JOIN in LINQ to entities?
- “A lambda expression with a statement body cannot be converted to an expression tree”
- How to compare only date components from DateTime in EF?
- ‘Date’ is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported
- Linq to Entity Join table with multiple OR conditions
- “The LINQ expression node type ‘Invoke’ is not supported in LINQ to Entities” – stumped!
- Calling a SQL User-defined function in a LINQ query
- MSSQL Error ‘The underlying provider failed on Open’
- Conversion of a datetime2 data type to a datetime data type results out-of-range value
- How do I apply OrderBy on an IQueryable using a string column name within a generic extension method?
- The cast to value type ‘Int32’ failed because the materialized value is null
- Getting data from stored procedure with Entity Framework
- Why is .Contains slow? Most efficient way to get multiple entities by primary key?
- Entity framework very slow to load for first time after every compilation
- How can I lock a table on read, using Entity Framework?
- Establish a link between two lists in linq to entities where clause
- Value cannot be null. Parameter name: source
- Linq to Entities, random order
- A specified Include path is not valid. The EntityType does not declare a navigation property with the name *
- Creating dynamic queries with entity framework
- LINQ to SQL multiple tables left outer join
- How to use a string to create a EF order by expression?
- Entity Framework/Linq EXpression converting from string to int
- Filter/Search using Multiple Fields – ASP.NET MVC
- How to Bulk Update records in Entity Framework?
- linq to entities doesn’t recognize a method
- EF 6 – How to correctly perform parallel queries
- Entity Framework 6 Code First Custom Functions
- Order by dynamic parameter
- String.IsNullOrWhiteSpace in LINQ Expression
- LINQ, Unable to create a constant value of type XXX. Only primitive types or enumeration types are supported in this context
- Check if list contains item from other list in EntityFramework
- How to get next value of SQL Server sequence in Entity Framework?
- Join and Include in Entity Framework
- Optimistic concurrency: IsConcurrencyToken and RowVersion
- Export Model to DataTable
- Max return value if empty query
- Remove item from list based on condition
- Keyword Not Supported: Metadata
- Why is EF generating SQL queries with unnecessary null-checks?
- How to do an “in” query in entity framework?
- How to Specify Primary Key Name in EF-Code-First
- linq to entities vs linq to objects – are they the same?