I have a simple database with users table, it have simple admin user with
UserName= "Admin"
Password="admin"
I am using NHibernate to query over this table to login form.
Suppose the login form inserted UserName="ADMIN"
and password="ADMIN"
both in upper case.
The system should not allow login. However when I use the query like this
using (var session = NhibernateHelper.OpenSession())
{
return new List<User>
(session.QueryOver<User>()
.Where(u => u.UserName == userName)
.And(u => u.Password == password)
.Future());
}}
The system ignores the case sensitivity and selects the user. So how can I make case sensitive query?