SQL server is case-insensitive using the default collation, so either case will work when the SQL query is executed against the database. When you call ToList()
, all the items are fetched from the database and put in a case sensitive List<T>
, then the items are filtered. As the List<T>
is case-sensitive, it will return false for lowercase values.
You should be using the first code you have, as otherwise in the case of a large table you will have performance issues as you will basically be doing a SELECT * FROM
with the second code.