Question

How can I union two criterias with OR statement?

For example I whant to get Employee wich have 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);

Thank you!

Was it helpful?

Solution

You need to use Disjunction()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top