'OR' in NHibernate Lambda Extensions
-
13-10-2019 - |
문제
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()
제휴하지 않습니다 StackOverflow