views:

222

answers:

5

Well I've been reading a couple of posts on this here on Stackoverflow but I'm still not not sure about the direction to take.

Basically I'm developing a product which I will maintain for the next 10 or more years so I want to decide now as to which framework to stick with.

So I need expert advice as to which framework I should adopt to avoid having to chop and change along the way.

+1  A: 

I'd say it depends on the application, but I prefer Linq-To-Sql. When I considered both options Entity Framework was still in a beta of sorts, I'm not sure if that has changed. Linq-To-Sql has been great for every situation I've used it. I'm addicted.

Shawn Simon
+4  A: 

MS are backing Linq-to-Entities over Linq-to-SQL.

http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx.

dommer
Pardon me?L2S has automatic lazy loading. L2E has explicit lazy loading. Both have optional eager loading on a property basis, but in L2S you cannot modify the eager/lazy behavior once you ran a query (you have to use another datacontext).
Denis Troller
@Denis Troller that's right, you configure it as the first thing when instantiating the data context. If you are mapping to custom objects and your linq query is grabbing all the data, it doesn't matters as it eager load anything in the query.
eglasius
A: 

Check this answer about it: http://stackoverflow.com/questions/653019/linq-to-sql-pitfalls/653089#653089.

eglasius
A: 

NHibernate

Dala
+2  A: 

It depends on what you're looking for. LINQ to SQL was touted as producing a direct mapping to the database structure. LINQ to Entities is more about modeling the entities you want, then mapping how those fit into the database structure, which could be different. For instance, a single Person entity could contain properties from the Person table and from the PersonDetail table.

Also, Microsoft have said that their focus for new features will be LINQ to Entities. That doesn't mean that LINQ to SQL will be deprecated or will not be supported; it's just that they're only going to invest in one, and LINQ to Entities is the more general. LINQ to Entities can handle data from pretty much any ADO.NET Data Provider, not just SQL Server.

John Saunders