views:

147

answers:

3

NHibernate and LINQ both or for Object-Relational mapping,apart from different vendor API, what is the difference between nHibernate and LINQ ?

A: 

The one main difference between them is that EntityFramework is a bit more database focused and nHibernate is a bit more object focused. That made a difference for our local development team.

Entity Framework assumes a data model in the database and works with it to map between the data model and your object model. nHibernate can work that way, but our developers liked the fact that nHibernate can simply override the data model and write the object model straight down to the database.The difference is NHibernate is an OR/M and is aimed at developers who want to focus on the domain rather than the database.

bala3569
EFv4 supports domain driven development (aka class first design), EFv1 does not.
Michael Maddox
+2  A: 

LINQ is a query language. nHibernate is an ORM. nHibernate can use LINQ to execute queries.

If you're referring to LINQ to SQL (which is another ORM) then I'd suggest checking out this question:

nHibernate or LINQ to SQL

Justin Niessner