Pergunta

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!

Foi útil?

Solução

You need to use Disjunction()

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top