see also Differences between LINQ to Objects and LINQ to SQL queries
We are using the some queries over our database and our in memory objects.
What is the best way of doing an insensitive string compare with linq-to-sql so that?
- It runs fast on SQL Server
- The same query expression can be used with linq-to-objects to get the same result
Using
a.ToLowerInvariant() == b.ToLowerInvariant()
at least gets the same results, but it does not get processed on SQL server as far as I can tell, so can be a lot slower then
a == b