For example, given the following code, how is it possible to make the string comparison case-insensitive?
var query = from employeeGroup in _session.Linq<EmployeeGroup>()
from employee in employeeGroup.Employee
where employee.UserName == username
select employeeGroup.EmployeeGroupName;
The NHibernate.Linq.SqlClient.SqlClientExtensions.Upper() method might help but this only seems to be available with SQL Server.
If I use the System.String class to do the comparison, I get an error: “Cannot use subqueries on a criteria without a projection.”. I believe this is because there is no direct mapping that NHibernate can do to SQL.
As far as I can tell, NHibernate Linq does not support case insensitive matching. This isn’t a problem for SQL Server which is case insensitive but obviously is for Oracle. I think you’ll have to use the Criteria API or HQL for this.