I tried this
incidentSubquery.WithSubquery.WhereProperty(x => x.Id).In (witnessTypesSubquery).
WithSubquery.WhereProperty(x => x.Id).NotIn(witnessTypesSubquery);
but the operator between the two sub queries is And operator how can I make it or operator instead of and .
One way could be:
incidentSubquery.Where
(
Restrictions.Disjunction()
.Add(Subqueries.WhereProperty<MyEntity>(x => x.Id).In(witnessTypesSubquery))
.Add(Subqueries.WhereProperty<MyEntity>(x => x.Id).NotIn(witnessTypesSubquery))
);
We can use Restrictions.Disjunction().Add(...).Add(...)
to join as much as possible OR statements.
Simplified version could be with Restrictions.Or(A, B)
(just two statements)