Question: Until now, I didn’t know LINQ was an ORM tool. I always saw it as some new kind of SQL query language. So I very recently started using nHibernate.
So my question:
What would be the advantages and disadvantages of LINQ in comparison to nHibernate?
As far as I found out, the differences are that LINQ requires .NET > 2.0 (unless you hack it, which is unsafe and illegal), while nHibernate works with >=2.0.
And that for LINQ, you need to have a vendor/3rd party LINQ provider dll if you don’t use MS-SQL.
What I don’t know in particular is which one is faster/easier, and whether there are LINQ providers for all databases supported by nHibernate, and how well LINQ works with mono.
Linq isn’t an ORM tool. Linq2Sql and the Entity framework are Microsoft ORM tools using Linq. I found this article comparing NHibernate to Entity Framework 4,0 quite enlightening.
To summarise: NHibernate, is long established and tested and Fluent is a joy to use. Unfortunately NHibernate suffers in the documentation dept, but is OS so you can dig into the code.
EF 1.0 was horrendous, but 4.0 is much better. It’s a MS product so is heavily evangelised, supported and there are many examples out on the web. 4.0 is still beta for now.