Reputation: 2922
I have been using ADO.NET in favor of LINQ to SQL (or Entities) up to this point. I'm starting a new project that should be smallish, at least at first but I would like to have room to expand down the line.
I feel now is a good time to get into LINQ. I've avoided it for quite a while; however, I'm concerned by the current direction of LINQ to SQL. I hear LINQ to Entities is going to be MS's preferred data access in the future. I'd rather not get into LINQ to Entities because: 1.) Most likely a steeper learning curve that I don't want to throw into the mix right now (already busy learning MVC) and 2.) I hear it's not ready for primetime.
My concern is this - if I start a project with LINQ to SQL now, can I easily upgrade it to LINQ to Entities down the line?
Upvotes: 5
Views: 765
Reputation: 4012
I've steered clear of the Microsoft ORMs and I'm rather glad that I have. There's a constant cycle of hype -> acceptance -> realization of weaknesses & flaws -> end-of-life, begin again.
Don't get me wrong, I'm a huge fan of .Net, just not Microsoft ORMs. There are better solutions out there.
I realize this is just opinion but I offer it for what it's worth.
Upvotes: 1
Reputation: 65391
It may be that LINQ to SQL is optimized for SQL server, to it may be a better fit for your problem than Entity Framework.
However, in the long run, you must consider how long your application is expected to live and what the cost of "upgrading" would be.
Upvotes: 0
Reputation: 12489
The people who say LinqToSql has a minimal learning curve are not being completely honest with you. ADO.NET has a significant learning curve. Any ORM has a significant learning curve. Once you've used one ORM, it's not too difficult to pick up another ORM. Once you've built your own ORM (for fun, don't do it for real), you'll really get what's going on.
Linq (I'm not talking about LinqToSql) is a great technology and you can't use Linq with ADO.NET, you need something like an ORM.
For many reasons (Linq being one of the stronger ones, ORM maturity being another), now is a great time to move from ADO.NET to an ORM.
From what I've seen, "upgrading" a project from one ORM to another (it doesn't matter which ORMs) is always difficult, unless you really know what you are doing and keep your ORM as loosely coupled from everything else as possible.
I would beware of both LinqToSql and EntityFramework (aka LinqToEntities). They are both lacking quite a few features that you'll likely need in the "real world". Neither are mature or proven (as the disagreements you've seen in the answers to this question help show).
There are mature, proven ORMs in the .NET space and it's not too hard to figure out which one is dominate right now.
Upvotes: 0
Reputation: 12397
If your app is going into production before .net 4.0 SP1 is available, go for L2S. Linq-to-SQL is stable, it will not go away anytime soon, and it generates great SQL. EF v1 don't. Period. Check out the MSDN EF forum if you want to know more about the EFv1 childhood diseases.
Whether EFv2 will be up to the task remains to be seen; I have only used beta 1 and that one does not have some of the improvements that later versions are said to have.
The "L2S vs EF" topic has been covered numerous times already, check out:
Is LINQ to SQL Dead or Alive?
...and personally, I think that Anders Hejlsberg's statement to Redmond Developer News makes it clear enough. "LINQ to SQL is not dead. I can assure you, it is not dead. Nothing ever goes away. We have never done that and we never will," he said.
http://reddevnews.com/blogs/desmond-file/2008/12/digital-darwinism.aspx
Upvotes: 4
Reputation: 19627
LINQ to Entities is ready for primetime, and not necessarily much steeper to learn. However, LINQ to SQL is fine too, you'll learn a lot that will stay useful as you move forward.
In short, choose whatever suits the project best. If SQL Server is and will remain the DB platform, and if there's no need for remapping tables or other sophisticated tricks, LINQ to SQL will get you there very fast. It's also very efficient.
Upvotes: 11
Reputation: 8763
Microsoft issued a statement that LINQ to SQL has reached its end of life and will no longer be providing any major improvements to it. Check out their official sugar-coated statement here. The Entity Framework will be taking its place.
Here is the MSDN article on how to port a LINQ to SQL project over to the Entity Framework.
Upvotes: 0