I am trying to write a query in linq that returns results like this:
PeopleEntities pe = new PeopleEntities();
String fName = "Τάκης";
var people = pe.Person.Where(per => per.FirstName.Equals(fname)).ToList();
When I dump the query using
String query = ((ObjectQuery)pe.Person.Where(per => per.FirstName.Equals(fname))).ToTraceString();
Console.WriteLine(query);
and then using the query in a MySQL WorkBench providing a value, everything works fine but in code the query returns nothing.
Edit: I have connected entity manager by using a MySQL connector. I hadn’t thought about it earlier but this is the problem as with an MsSQL connection everything works fine
Any ideas on how I can execute the above?
In a regionally-sensitive query, you should not use
string.Equals()without providing a StringComparison value, e.g.:Yes, this overload is supported in L2E.
If that still does not work, it is possible that the AppDomain’s current culture or the DB’s collation is wrong. Look at the query/params in SQL Profiler.