Tradeoffs using NHibernate 3.0 QueryOver or LINQ provider

后端 未结 4 777
广开言路
广开言路 2020-12-02 22:26

I have not found a clear comparison of what is supported with the NHibernate 3.0 LINQ Provider compared to using the QueryOver syntax. From the surface, it seems like two l

4条回答
  •  执念已碎
    2020-12-02 23:19

    I have used both NH-Linq-providers (the old NHContrib for Version 2.1, and also the new for NH3.0) and also used QueryOver. With all the experience made during development of quite complex data-driven applications, I would strongly suggest NOT to use the existing linq-provider with nHibernate if you plan to go behind just basic CRUD-operations!

    The current implementation (linq) sometimes produces really unreadable and also unefficient SQL. Especially joining some tables quickly becomes a nightmare if you want to optimize database-performance.

    Despite all these drawbacks, I did never encounter wrong queries. So if you don't care about performance and are already familiar with LINQ, then go for NH-Linq. Otherwise QueryOver is your realiable and typesafe friend.

提交回复
热议问题