Something really simple to do in SQL, but for some reason I cannot figure out how to do it in NHibernate.
Code:
select * from cars where (car_id = 3) or (share = 1)
Here's what my code looks like without the OR
Code:
Cars[] ct = Cars.FindAll(
new ICriterion[] {
Expression.Eq("CarId", id)
}
);
So...
I'd like to add the OR in there. I was thinking it was like this:
Code:
Cars[] ct = Cars.FindAll(
new ICriterion[] {
Expression.Eq("CarId", id),
OrExpression.Equals("Share", true)
}
);
That gives me this error:
Cannot implicitly convert type 'bool' to 'NHibernate.Expression.ICriterion'
Any help is appreciated!