Disjunction and Conjunction in NHibernate

Criteria involving multiple ORs and ANDs can quickly become ugly. David showed how some of our code became more readable by using a feature to join multiple ICriterion-s instead of using Restrictions class (as well as how to quickly leverage expressions to get away from using property names, and allow better refactoring by replacing strings with compile-able code).

James Gregory has provided earlier a very simple explanation on the subject. Absolutely love when things become simpler!

No Comments