문제

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!

도움이 되었습니까?

해결책

You need to use Disjunction()

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top