如果开始你会使用什么你的ORM NHibernate的或LINQ,为什么一个新的项目。各有什么利弊。
If starting a new project what would you use for your ORM NHibernate or LINQ and why. What are the pros and cons of each.
编辑:LINQ to SQL的不只是LINQ(感谢@乔恩Limjap)
edit: LINQ to SQL not just LINQ (thanks @Jon Limjap)
我问自己,只是用NHibernate的我在想WilsonORM,我有考虑pretty的不错。一个非常类似的问题。
I have asked myself a very similar question except that instead of NHibernate I was thinking about WilsonORM which I have consider pretty nice.
在我看来,有很多重要的区别。
It seems to me that there are many important differences.
LINQ:
不是一个完整的ORM工具(你可以有与像最新的实体框架一些其他的库 - 我个人认为,从MS这一最新的技术架构是大约10岁的时候与其他ORM框架相比) 主要是查询语言支持智能感知(编译器会检查你的查询语法) 主要与Microsoft SQL Server使用 是闭源NHibernate的:
NHibernate:
是ORM工具 有pretty的不限量的智能感知查询语言 可以几乎您拥有一个DB提供任何DBMS使用 是开放源代码的这要看。如果你开发了丰富的(Windows)中的桌面,你需要构造对象,与他们的工作进行到底坚持自己的改变应用程序,那么我会建议ORM框架,比如NHibernate的。
It really depends. If you develop a Rich (Windows) desktop application where you need to construct objects, work with them and at the end persist their changes, then I would recommend ORM framework like NHibernate.
如果您开发通常只是查询数据只是偶尔写一些数据传回数据库,那么我会推荐优秀的查询语言像LINQ的Web应用程序。
If you develop a Web application that usually just query data and only occasionally writes some data back to the DB then I would recommend good querying language like Linq.
所以一如既往,它依赖。 : - )
So as always, it depends. :-)