I'm using s#arp architecture and NHibernate 3.1.
I'd like to randomly select 10 rows from a table and I'm following the advice given in this page Linq Orderby random ThreadSafe for use in ASP.NET
The solution involves doing XOR in the database and my query looks like this
repo.FindAll()
.OrderBy(q => ((~(q.QuestionId & seed)) & (q.QuestionId | seed)))
.Take(10);
And I get the following error: Unable to cast object of type 'NHibernate.Hql.Ast.HqlBitwiseAnd' to type 'NHibernate.Hql.Ast.HqlBooleanExpression'
When I remove '~' from the query I don't get the error. Is this a bug in NHQueryProvider that cannot understand '~' as bitwise operation?