I have more than 600,000 records and 20 columns in a table.
I would like to use a LINQ query and use a function that works as a "LIKE"; So for that I used Contains. It's taking time (or) it throws a timeout expired exception.
So can anyone suggest how to solve this issue? I need to compare more than 4 columns.
var majorAgents = new[] { "iPhone", "Android", "iPad" };
List<Person> lstperson =_context.person.where
(w=>majorAgents.Any(x=>w.personLastName.contains(x))
|| majorAgents.Any(x=>w.personFirstName.contains(x))
||w.Address.Any(s=>majorAgents.Contains(s.addressProof)))//Address table referenced as a list
.select(s=> new Person{
s.personId,
s.perosnLastName,
s.personFirstName
}).ToList();