var query = someList.Where(a => (someCondition)? a == "something" : true);
so, if ‘someCondition’ is false, ‘Where’ will be skipped.
More Related Contents:
- How to create a dynamic LINQ join extension method
- Greater Than Condition in Linq Join
- Multiple “order by” in LINQ
- C# LINQ find duplicates in List
- What are the benefits of a Deferred Execution in LINQ?
- Convert string[] to int[] in one line of code using LINQ
- Extension methods must be defined in a non-generic static class
- Linq with group by having count
- LINQ Partition List into Lists of 8 members [duplicate]
- LINQ Between Operator
- LINQ recursion function?
- What’s the hardest or most misunderstood aspect of LINQ? [closed]
- LINQ OrderBy versus ThenBy
- LINQ: Dot Notation vs Query Expression
- Learning about LINQ [closed]
- What’s the difference between IQueryable and IEnumerable [duplicate]
- Hierarchical data in Linq – options and performance
- Can LINQ be used in PowerShell?
- Use LINQ to concatenate multiple rows into single row (CSV property)
- PowerShell equivalent of LINQ Any()?
- Instantiating a context in LINQ to Entities
- conditional include in linq to entities?
- Linq To Entities – how to filter on child entities
- Is there a pattern using Linq to dynamically create a filter?
- Entity Framework, Code First and Full Text Search
- Simple Linq query has duplicated join against same table?
- Code equivalent to the ‘let’ keyword in chained LINQ extension method calls
- Linq to SQL how to do “where [column] in (list of values)”
- Linq: What is the difference between Select and Where
- LINQ: How to convert the nested hierarchical object to flatten object