score:1
Accepted answer
Have you tried this:
var predicate = PredicateBuilder.False<MusicSheet>();
foreach (var term in terms)
{
string keyword = term;
predicate = predicate
.Or(s => s.Title.Contains(keyword) ||
s.Authors.Any (a => a.Name.Contains(keyword) || a.Bio.Contains(keyword)));
}
Source: stackoverflow.com
Related Query
- LinqKit PredicateBuilder with EF 4 CPT 5 table relationships?
- Why is this code with PredicateBuilder not working?
- Is there a way to use PredicateBuilder with Azure Table Storage?
- Trouble generating c# linq to entities (EF) query for a 3 table join with or and one table with no key relationships
- How to delete a row in a table and all its foreign key relationships with Entity Framework?
- EF Code First: Relationships with differing key names
- Generic code to determine how many rows from a table are in a different table with matching structure?
- How to use pagelist with data source as multiple tables, to display table values in mvc?
- What does this C# code with an "arrow" mean and how is it called?
- Casting to a derived type in a LINQ to Entities query with Table Per Hierarchy inheritance
- loading a full hierarchy from a self referencing table with EntityFramework.Core
- How do I query an Azure storage table with Linq?
- Linq to Entity Join table with multiple OR conditions
- Use LinqKit PredicateBuilder for related model (EF Core)
- Entity Framework retrieve data from table with foreign key
- Automatically checking for NULL relationships with LINQ queries
- Writing an extension method to help with querying many-to-many relationships
- Deleting rows in a table with Linq to SQL
- How can I extract a list of Tuple from a specific table with Entity Framework / LINQ?
- How to get the latest date inserted from the table with Linq to entities
- LINQ table join with entity Framework
- Why doesn't this code compile in VS2010 with .NET 4.0?
- Linq to Entities, Table per Type and Nullable Foreign Key Relationships
- Joining two tables with LINQ while also returning null records from the second table
- Can you advise me a resource with LINQ/lambda code exercises?
- How to search any property from a table with linq?
- LINQ Source Code Available
- Read huge table with LINQ to SQL: Running out of memory vs slow paging
- Create table with Linq to Sqlite (linq2db)
- Linq PredicateBuilder with conditional AND, OR and NOT filters
More Query from same tag
- Dynamic Linq Predicate throws "Unsupported Filter" error with C# MongoDB Driver
- Distinct doesn't work on Entity Framework
- Linq Order by List<int> of IDs given
- Compare two collections with linq and populate variable
- Using Async/Await inside nested LINQ-Select without having to use Task.WhenAll
- Not able to return JsonResult
- LINQ RavenDB sub collection query using Any, cannot include non-indexed variables in query
- How to filter from multiple colums using LINQ
- Linq to XML, retrieving list from like names elements
- Multi nested FirstOrDefault
- LINQ expression in where clause with two collections
- yield return empty character literal
- How to join two customer lists into one list
- How can I move on column data to another column in the same row using linq
- How to return IGrouping from Linq query when grouping
- Get distinct values of List in List
- Split collection into groups of different sizes
- Why is there no Linq method to return distinct values by a predicate?
- Assign member variables from view model to query result
- How to get the last sub string from the url using linq
- Dynamic where clause to filter collection elements
- Bind Exclude Asp.net MVC doesn't work on LINQ Entity
- Store value in dictionary or retrieve from concatened key
- DbSet include extension method looping
- How to optimize a code using DataTable and Linq?
- LINQ JOIN performance optimization
- Check if value already exists in dictionary<string, List<string>>
- Retrieving an item from a list based on selected value
- How to know if OrderBy was applied to query?
- Convert LINQ return type to C# class