I use LINQ a lot in general, especially LINQ-to-Objects, hence I\'m rather fluent in LINQ.
I was considering to use LINQ-to-NHibernate as the query language for my NHibe
It looks to me as if NHibernate.Linq doesn't support this optimisation right now. I think you'll need to use a criteria query, or HQL, or wait until the fully integrate LINQ provider is released (slated for NHib v3 I think).
Cheers, John
Do you use the latest release?
I'm yet to try it myself. But I have to say, I always bump into issues while trying to use Linq-to-NHibernate. Well, maybe I'm too much newbie to both of them... but Linq is supposed to be intuitive, and there's nothing intuitive in getting null reference from a damn simple query (like your one) that works perfectly in HQL.
But it's understandable since that was in development. And still is, I suppose ;-)