Hi,
My problem is the following:
I'm looking for a solution in LINQ which translates a LINQ expression to SQL LIKE query.
(I know in LINQ I can use Contains, StarsWidth, EndWidth instead of 'LIKE' but in my case is not a good solution, and if you check the generated sql script you will see it is not use LIKE)
I found a lot of article that use the System.Data.Linq.SqlClient.SqlMethods.Like methods so I wrote my query:
var query = from c in _context.prgCity where SqlMethods.Like( c.FullName, "%buda") select c.FullName + "|" + c.prgCountry.CountryName;
return query.ToList<string>();
But when query is running I get the following error message:
"LINQ to Entities does not recognize the method 'Boolean Like(System.String, System.String)' method, and this method cannot be translated into a store expression."
Anybody can Help me what I do wrong?