I’m looking for an NHibernate criterion which does not add a restriction to a criteria. The reason for this is that I have a method which converts some input parameters into a criterion which is added to a criteria. There is a constellation of the input parameters where no restriction needs to by applied. Therefore I want to return some kind of dummy criterion.
Is there something like that in NHibernate?
Best Regards,
Oliver Hanappi
well you could do something like Restrictions.IsNotNull(“id”) if querying against an entity with ‘id’ being a primary key (and so can never be null). Anything that evaluates to no logical restriction can be used based on your requirements.