Moving from LINQ to SQL to LightSpeed
Tagged as LightSpeedLINQ to SQL has been a very popular technology with SQL Server users, providing far greater ease of use than previous Microsoft data access technologies and introducing many .NET developers to the concept of object-relational mapping. However, LINQ to SQL delivers only very basic domain modelling capabilities — no aggregates, no value objects, etc. Not to mention that it’s tightly coupled to SQL Server and that Microsoft, who are trying to encourage adoption of the Entity Framework instead, are no longer enhancing LINQ to SQL.

Figure 1. Microsoft’s roadmap for the popular LINQ to SQL framework. (Artist’s impression.)
So what if you’re hitting the limitations of LINQ to SQL and want to move on to something better? Or what if you just want to try out an alternative ORM, but don’t want to have to build a whole new model from scratch just to try it out?
First things first: this is never going to be a completely transparent process. Every ORM has different conventions for defining units of work (LINQ DataContexts), setting up configuration, and so on. Having said that, LightSpeed 3 does include a handy new feature that should cut down on the workload.
If you drag a LINQ to SQL DBML file from Solution Explorer into a LightSpeed model, we’ll load your existing LINQ classes into the LightSpeed model. Easy as that! So you can easily keep your model, including any customisations and mappings; plus now you get all the benefits of the LightSpeed designer, like database synchronisation, and can start marking up your model with LightSpeed features such as eager load aggregates.
Here’s how it looks – the original LINQ to SQL model on the left, and the LightSpeed model on the right (click for full size):
A basic version of LINQ to SQL import is included in the LightSpeed 3.0 RTM. We’ve rounded out this feature a bit in the nightly builds, so if your LINQ model uses inheritance or access modifiers, you’ll want to get the updated version. As always, if you’re using a LINQ to SQL feature that the converter doesn’t handle, let us know and we’ll see what we can do.
2 Responses to “Moving from LINQ to SQL to LightSpeed”
Leave a Reply
![]()
BrainDump (1)
Community Code (1)
Events (7)
General (34)
Lab Samples (2)
LightSpeed (144)
MegaPack (3)
News (52)
NHibernate Designer (4)
Products (68)
Projects (4)
Screencast (6)
SharePoint (2)
Silverlight (7)
Silverlight Elements (14)
SimpleDB Management Tools (12)
Visual Studio (4)
VS File Explorer (6)
WPF (34)
WPF Diagramming (17)
WPF Elements (30)
WPF Property Grid (26)
![]()
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007






Posted by Ivan Towlson on 14 January 2010



Does it handle multi key entites. That would be a nice shortcut to create a linq to sql with designer multi primary key then drag it to ligthspeed as a shortcut.
Hmm, I haven’t tested it with composite primary keys, but it should work. Just to understand, does this mean our designer CK support is missing something that you find useful in the LINQ to SQL designer? If so, do let us know and we’ll see if we can improve it.