0

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);
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Serhiy
  • 4,357
  • 5
  • 37
  • 53

1 Answers1

1

You need to use Disjunction()

Community
  • 1
  • 1
Sly
  • 15,046
  • 12
  • 60
  • 89