<< back to blog

NHibernate Trick

nhibernate ~ .net

21 Jul, 2009

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...
.NET Gem Fun
Automating .NET development (and NHibernate) with IronRuby + Rake
Get a Rails-Stylee Interactive Shell For Your NHibernate Backed Domain Model
In Memory SQLite Testing with NHibernate
NHibernate Trick
NHibernate: Calling Update Unnecessarily
.NET Config for Multiple Developers
NHibernate in Action 2nd Edition - Your Opinion
Shorthand Repository Accessors
NHibernate for Ruby?

kick it on DotNetKicks.com
blog comments powered by Disqus