I am trying to implement broad searching functionality from my database. Let's say I have an entity that has multiple attributes such as: Student
has firstName
, lastName
, address
, etc...
What is the best way to search my database to find any record that has matching attributes?
var Result = _context.Student.Where(s =>
s.firstName.Contains(query)
|| s.lastName.Contains(query)
|| s.address.Contains(query)))
.ToList();
Is there a better and faster way to do the search?