Just in case you didn’t realise, I’m doing a talk on “LINQ for SQL” at this weekend’s CodeCampSA. Yes, I’m the first “real” speaker after morning tea on Saturday!
I’ll be doing an updated version of the presentation I did for the [SQL User Group in February]/2007/02/linq-to-sql-talk_16.html).
At that time, the latest LINQ for SQL was the May 2006 CTP which installed on top of Visual Studio 2005. Since then Microsoft have [released Beta 1 of Visual Studio 2008]/2007/04/visual-studio-code-name-beta-1.html) which has also incorporated some language syntax changes to Visual Basic related to the LINQ bits. Fabio has listed some of the framework changes since last year.
Bits that affected my presentation include:
- The Visual Studio LINQ to SQL Designer now works pretty well (no need to use the SQLMETAL.EXE command-line tool)
- Overriding insert/update/delete operations now doesn’t use attributes (this is a bit strange) on the methods.
- Projections in VB don’t need to use New, and you use ‘=’ instead of ‘:=’.
I also did some testing of SQL generated for SQL Server 2000 versus 2005. It turns out LINQ for SQL is smart enough that it uses 2005 features (eg. ROW_NUMBER) when they will perform better.