'OR' in NHibernate Lambda Extensions

237 Views Asked by At

How can I union two criteria with an OR statement?

For example I want to get Employee which has null in Birthday field OR value of this field is less than someDate. How should I rewrite this code:

var query = DetachedCriteria.For<Employee>()
    .Add(SqlExpression.IsNull<Employee>(p => p.Birthday))
    .Add<Employee>(emp => emp.Birthday.Value < someDate);
1

There are 1 best solutions below

0
On BEST ANSWER

You need to use Disjunction()