Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

predicate EF Core search query

var terms = title.Split(' ').ToList();
Expression<Func<Item, bool>> predicate = (Item) => false;
foreach(var term in terms)
    predicate = predicate.Or(x => x.ItemName.Contains(term));

items = items.Where(predicate);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #predicate #EF #Core #search #query
ADD COMMENT
Topic
Name
8+5 =