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,475
  • 28
  • 40
  • 37
Serhiy
  • 4,239
  • 5
  • 35
  • 52

1 Answers1

1

You need to use Disjunction()

Community
  • 1
  • 1
Sly
  • 14,608
  • 12
  • 60
  • 89