I\'m trying to get distinct results using the Criteria API in NHibernate. I know this is possible using HQL, but I would prefer to do this using the Criteria API, because th
We are using the most modern and powerful and impressively tiny means of all to handle this...read on only if you're prepared for the awesome...and it has NOTHING to do with criteria...
CurrentSession()
.QueryOver
.Where(...)
.TransformUsing(Transformers.DistinctRootEntity)
So, if you've come here hoping for a way to do this that has you avoiding messing with Criteria even though you though you would totally have to go in that direction just to add 'DISTINCT' into your SQL...search no further