views:

587

answers:

3

With .NET, which data access method is better to use "LINQ to SQL",entity framework, or NHibernate?

Should a different method be used depending on the situation or is it more of a personal preference?

If so which method and when?

+1  A: 

MVC has nothing to do with data.

I also wonder where you've been hiding if you've been hearing about these things "every couple of months". Both LINQ to SQL and Entity Framework were part of .NET 3.5, released last year.

John Saunders
I thought EF wasn't available til .net 3.5 sp1 and linqToSql was part of .net 3.0.
x13
You may be confusing .NET 3.0 with C# 3.0. See http://msdn.microsoft.com/en-us/library/bb308959.aspx.
John Saunders
EF wasn't release until SP1 of .NET 3.5, but that was about a year ago now anyway.
Alex James
+4  A: 

MVC is unrelated to data access. If you're wondering whether to choose between Linq2Sql, EF or something else, my answer until the release of the new EF is to go with NHibernate, fluent or otherwise.

Dmitri Nesteruk
I have used linqToSql, played with EF, and read a short article of MVC (sorry for my confusion), but never looked in to NHibernate. I'll definitely try it out before I start my next project. <br>Thanks
x13
+2  A: 

I depends on the complexity and goals of the project . If you are aiming at bringing some simple sets of data in using plain sql then linq-to-sql is good . But if you are planning to take advantage of sophistication of full fledged ORM , like first and second level caching, transactional write behind, oo query language,plugin points ect.. then Nhibernate is the way to go .

Surya