How to create OR statements for NHibernate?

You’re looking for the Conjunction and Disjunction classes, these can be used to combine various statements to form OR and AND statements.

AND

.Add(
  Expression.Conjunction()
    .Add(criteria)
    .Add(other_criteria)
)

OR

.Add(
  Expression.Disjunction()
    .Add(criteria)
    .Add(other_criteria)
)

Leave a Comment