views:

1310

answers:

9

What major features are missing from Linq-to-Sql?

  • Compatibility with other major SQL Database Engines (MySQL etc)
  • Mapping Many-to-Many relationships
  • Any others?

I have already developed a major project with Linq-to-Sql at it's DAL Heart. i hadn't developed using a relational data mapper before, so it was a learning curve coming from datasets. But i didn't find any major problems which couldn't be solved with Linq-to-Sql. My testing concluded that it was significantly faster than Linq-to-Entities.

So what major features are missing from Linq-to-Sql?

I guess what i am trying to ask is if development on Linq-to-Sql is ceased - will it matter?

A: 

unless microsoft can make entity framework better than linq to sql for both speed and simplicity it doesn't matter IMHO.

ggf31416
+3  A: 

Maybe the biggest thing missing is a future

I tend to agree with this post I linked to, MS say that there will be ongoing development on Linq to SQL, but their actions (or more specifically non-actions) tell a different story. MS certainly want you to bet on Linq to Entities instead.

Tim Jarvis
I disagree. Just because MSFTs marketing machine tells us "x is dead, use y instead" doesn't make it true. Maybe it will be if they can make EF/L2E mature enough to replace L2S but until then it is IMO premature to declare it dead.(Just as it is premature to claim that Winforms is dead and everyone should rush to use WPF instead, or that webforms is dead and everyone should use silverlight instead, or that Win32 and COM are dead and everyone should use .net instead.)
KristoferA - Huagati.com
@KristoferA: L2S was dead out of the gate.. It's just taking the early adopters awhile to figure it out.
Chris Lively
The spirit of LINQ-to-SQL lives on in a project called IQToolkit. If you're the L2S-type of person give IQToolkit a spin.
romkyns
A: 

I have been developing a system using it recently. My co-worker who designed the DB it hooks into has done some of the L2S coding for it as well. The two things he whinged (incessantly) about were:

1/ No baked in way to do bulk deletes based on some condition. L2S will end up deleting the rows individually which is highly inefficient. There are a number of blogs discussing various work-arounds for this.

2/ Updates require the cumbersome mechanic of querying for an object, updating it and then committing the changes, i.e. the initial query shouldn't be necessary. If you know the key for a row you should be able to just update it directly without a prior query.

+3  A: 
  • Good support for eager loading
  • Advanced mapping (ie not a 1-to-1 mapping between classes and tables)
  • the ability to refresh the mapping with database changes
liammclennan
Although not supported out-of-the-box, #3 is supported by 3rd party tools: http://www.huagati.com/dbmltools/
KristoferA - Huagati.com
FWIW, you can add eager loading in linq-to-sql with the DataLoadOptions - in the handful of cases where I needed to do so, it worked great.http://msdn.microsoft.com/en-us/library/system.data.linq.dataloadoptions.aspx
James Manning
+1  A: 

I've been using linq to sql heavily for months. The only nit I've found is that adding a predicate onto a mix of stored procedure and programmatically generated results will try to push the query down to SQL, before the programmatic results have been calculated. This is easily fixed by calling .ToList() first.

Every once in a while I wish for a Linq to Entity feature, but linq to sql accomplishes 95% of what I want.

shapr
+2  A: 

First of all, it isn't dead. Although it is not getting any new features in 4.0, they have fixed a bunch of bugs and quirks and I'm sure they will continue to do so.

Check out the Linq-to-SQL change list for .net 4.0:
http://damieng.com/blog/2009/06/01/linq-to-sql-changes-in-net-40

IMO it may be a good thing that they're not touching too much of the core - it is solid, efficient and generates really good SQL in most cases so any major surgery would just risk breaking some of the goodies. The few missing bits in both the designer and runtime can be bolted on or worked around.

Also, Matt Warren, the guy who originally wrote L2S at MSFT has written a "version 2" that he has published as open-source (MS-PL) on his blog and on codeplex.com. He calls it the IQToolkit but I would like to refer to it as L2Sv2... :)

Check it out at:
http://blogs.msdn.com/mattwar/
http://www.codeplex.com/IQToolkit/

KristoferA - Huagati.com
A: 

It's an issue of mind over matter.

If you don't mind it doesn't matter.

Alex
+1  A: 

I don't think it's dead. I think it will be worked on and the current issues will probably disappear. But i don't think it's going to be anything more than what it is now. Does it matter? I personally don't think it does. I think the framework is good as it is. The 2 major issue i found with L2S was the inability to easily detach entities and the awkward update mechanism.

Sergey
+1  A: 

Linq to SQL has no easy support for multi-tier architectures.

The Entity Framework was designed from the start to support distributed scenarios. While in .Net 3.5 EF wasn't completely there (at least in an automatic way), it laid the ground for further improvements. So, in .Net 4.0 the EF adds T4 templates to code-gen Self-Tracking entities and DTOs.

Rafa Castaneda