<< back to blog

NHibernate Trick

Jul 21, 2009, nhibernate ~ .net

I recently remembered this old NHibernate query trick:

var found = UoW.Session.CreateQuery("from Object o").List();
foreach (var item in found) Console.WriteLine(item.ToString());

As you might guess, this selects every instance of every mapped entity in your entire database. Useful? Probably not. Fun? Yarp!

You may also like...

blog comments powered by Disqus