Is there a nice succinct way to get random rows using query over? Something like this:
.QueryOver<Stuff>(() => entity)
.OrderBy(x => Guid.NewGuid()).Asc
.Take(3)
.List();
This doesn’t work unfortunately.
Check out this article:
http://puredotnetcoder.blogspot.com/2011/09/nhibernate-queryover-and-newid-or-rand.html
The key, I believe, is getting the query engine to generate the random value while executing the query, rather than specifying a value from the application (which may seem random to the application, but not to the query engine).