I have the following code segment in which I’m getting error
using (var session = Database.OpenSession())
{
var q = from x in session.Query<User>()
where x.UserName == username & x.Password==EncodePassword(password)
select x;
if (q.Count() > 0)
{
result = true;
}
}
on the if statement I’m getting error
Unable to cast object of type 'NHibernate.Hql.Ast.HqlBitwiseAnd' to type 'NHibernate.Hql.Ast.HqlBooleanExpression'.
What about:
Check the double ampersand in your query, right in the
wherepart.