I am using EF 6 + npgsql. I am trying to run a query that checks if a user with a given name (case insensitive) exists in db. I tried:
context.Users.Any(u => u.Name.Equals(username, StringComparison.InvariantCultureIgnoreCase))
however it doesn't work. Any help ?
var name = (username ?? string.Empty).ToLower(); var any = context.Users.Any(u => u.Name.ToLower() == name);SQL_Latin1_General_CP1_CI_AS. Or intercept the query to addCOLLATE SQL_Latin1_General_CP1_CI_ASquery in the where clause (but this will be overkill).