How do you check if all the search terms exist in a specific field.
search terms option 1: green white,
search terms option 2: test query,
search terms option 3: green query.
var search_result = (from s in dbContext.databasetable.Where
(i => 1.city == "NYC"
&&(search_text.Any(x => i.name.Contains(x))
|| search_text.Any(x => i.surname.Contains(x))))
select s).OrderByDescending(i => i.Date);
search_text is an string array
record in database:
name: green white red
surname: search test query
option 1 and two must return the record while option 3 must return "null".
The word must all exist in the name or must all exist in the surname.