Possible Duplicate:
How to do SQL Like % in Linq?
I am trying to implement the code below in LINQ, but still I couldn't find a way:
SELECT * FROM Persons
WHERE City LIKE '%tav%'
How can I write this in LINQ?
Something like this:
var query = dataContext.Person.Where(p=>p.City.Contains("tav"));
Depending on your sql server configuration you may need to compare only lower-case or upper-case letters:
var query = dataContext.Person.Where(p=>p.City.ToLower().Contains("tav"));