Hello,
I have this error :
{"Unable to cast object of type 'NHibernate.Hql.Ast.HqlBitwiseAnd' to type 'NHibernate.Hql.Ast.HqlBooleanExpression'."}
I create a predicate in C# with Expression Method, like this :
var listExpression = new List<Expression>();
var parameter = Expression.Parameter(typeof(T));
listExpression.Add(
Expression.Call(
((MemberExpression)memberExpression), "Contains", null,
Expression.Constant((string)MyValue))
);
Expression body = Expression.Constant(true);
foreach (var expression in listExpression)
body = Expression.And(body, expression);
The predicate looks like : see attachment.
I use this predicate like this :
session.QueryOver<Customer>().Where(prediate).List()
That's work when I have one condition in my predicate but I get the error when I have more than one
Any idea ?