Linq to SQL

MetaCMS V2

17 October 2009 |

I briefly got the chance to talk about MetaCMS, the content management system and e-shop platform I’ve designed and built, a while back. Since then a lot of sites have been built using it. Some of which (the biggest ones) include: www.nooz.gr (former www.flash.gr) ...

Linq to SQL => far from dead

14 October 2009 |

There are quite a few developers that believe that Linq to SQL is dead in favor of EF. That’s not the case though and I have the facts to prove it. Here’s the list of changes that are coming with the next .net framework, .Net 4.0. Performance Query plans are reused more often by specifically defining text parameter lengths (when connecting to SQL 2005 or later) Identity cache lookups for primary key with single result now includes query.Where(predicate).Single/SingleOrDefault/First/FirstOrDefault Reduced query execution overhead when DataLoadOptions specified (cache lookup...

ASP.NET Tips and Tricks

21 September 2009 |

I’m starting a new line of blog posts in which I’m going to give out a few tips and tricks I’ve picked up during the past years. I’m going to start with one of the most common mistakes I often face when reading code. To demonstrate that, I’m going to use LinqToSQL as my data access method (although the problem can be found in any kind of Data access technology) and use the the same model I used in my earlier Caching series. As you can see the model is very simple and contains just three entities, a Peson, its Phones and...

Linq To SQL Caching Adventures Part 2

06 September 2009 |

Before picking up where I left off yesterday, I have to first make a small disclaimer. I received a couple of comments stating that the caching solution I presented wasn’t that sophisticated or complete or that the cache keys that I’ve used were not the right and the answer is of course “yes”. The solution I presented was far from perfect but it served well as a simplified demonstration of the problems one might face when caching Linq to SQL entities. Ok now that we’re done with the typicalities let’s see what was wrong with the solution shown earlier. To demonstrate...

Linq To SQL Caching Adventures Part 1

03 September 2009 |

A caching solution is always necessary if you want to build scalable applications which will handle lots of users and heavy data access without requiring more hardware resources. I’ve already talked about caching when using Entity Framework, but is there a way to use caching in Linq to SQL and what are the problems one might face. To explore caching in Linq to SQL I’ve built a small web site that had a single page. This page used Linq To SQL to access the AdventureWorks sample Database which you can download from Codeplex. The very simple Linq To SQL model that...

MSLinqToSQLGenerator fails after extending a model

20 August 2008 |

I'm using Linq to SQL for a project I'm working on lately and as you can imagine I've extended the partial classes that MSLinqToSQLGenerator creates to fit certain needs (basically enumerations). After installing Visual Studio 2008 SP1 though I discovered that whenever I saved my model the above mentioned custom tool was failing to generate the LinqToSql classes. I had to, first delete my custom code file, run the custom tool to generate my LinqToSql classes and then add the custom code file again to get it working. What I discovered after a few tests is that in...