I’ve used many code generators over the last few years. I like LinqToSql but after using ADO.Net Entity framework, working with business entities is a must!
As mentioned I had moved to LINQ to SQL from EF a short time ago, primarily due to issues surrounding the use of detached entities and passing entities around an N-Tier design; also the issue with relationships. LINQ to SQL out of the box didn't fully support what I wanted to do but it was more manageable than EF.
Enter PLINQO. PLINQO ( Professional LINQ to Objects ) is a set of CodeSmith templates that wrap and extend LINQ to SQL functionality. This has been a huge timesaver for me, I have been using PLINQO for only a week now and it has already saved me a ton of time. Right off the bat you get full support for Entity.Detach and Entity.Clone is compelling. EF 4.0 appears to taking a similar approach.
After a few simple installation steps I was up and running with a full working solution generated for my Sensor Deployment Framework database. You can watch the intro videos – but trust me, make sure you set the QueryPattern to “ManagerClasses”.

Nice – working with the CodeSmith tool, PLINQO generated an Entities folder with classes mapping to my database tables. My favorite, a Managers folder with [ClassName]Manager.cs files for all classes. This follows a pattern I have used for many years and this alone will same me some much needed time.
There are some performance enhancements over basic LINQ to SQL too. PLINQO provides support for batch updating and deleting, effectively eliminating performance killing round trips to the server. The PLINQO generated DataContext also offers an overloaded ExecuteQuery method that lets you execute as many queries as you want within one trip to the database. This can save significant amounts of time if you have many queries that you need to perform one after another.
Stay tuned, I’m going to do some performance testing of the Query Result Cache and see how it holds up under a load. I’m going to put this collection of generated code and the framework to the test over the next few weeks.
Thank You for listening.