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.