Linq to NHibernate vs. ICriteria

后端 未结 2 1850
南方客
南方客 2021-02-06 14:52

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

相关标签:
2条回答
  • 2021-02-06 15:32

    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

    0 讨论(0)
  • 2021-02-06 15:33

    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 ;-)

    0 讨论(0)
提交回复
热议问题