Templated code gen for LINQ to SQL

This is going to be a brief one. If you are using LINQ to SQL, you should check out Damien's new templated code generator sample. One of our regrets from LINQ to SQL V1 days was not providing an easy way to tailor the code-gen. This is one step in that direction.

 Another major step would be to preserve "excluded" tables/columns/sprocs/... in dbml. So any change in schema can be handled appropriately as new/deleted database object (a rename could be treated as a removed column and an added column from metadata perspective).

 Dinesh

 

Published 07 August 08 09:32 by Dinesh.Kulkarni

Comments

# a-foton » Templated code gen for LINQ to SQL said on August 8, 2008 1:33 AM:

PingBack from http://blog.a-foton.ru/2008/08/templated-code-gen-for-linq-to-sql/

# Kodeo said on August 16, 2008 6:14 PM:

Reegenerator (<a href="http://www.reegenerator.com">http://www.reegenerator.com</a>) allows you to customize the code generated by the LINQtoSQL designer. You will still be using the default designer but you can have full control over the generated code.  Watch how to do it at http://www.reegenerator.com/ShowVideo.htm?video=Replace.swf

The video shows you how easy it is to start building a LINQtoSQL code generator that gets invoked by the LINQtoSQL default designer.

You can download the code generators at http://www.reegenerator.com/TemplatesGallery.htm. This page gives you replacements for LINQtoSQL, Dataset, Resources and Settings designers (C# and VB). All the renderers emulate the default behaviour in order to offer you a familiar starting point for any customization you want to implement.

If your customizations are minimal, you can invoke the default code generator, capture the results as a string, modify them as you like and return the modified results to Visual Studio to be saved in the .Designer.cs file.

New Comments to this post are disabled

About Dinesh.Kulkarni

I am a program manager in the Visual C# Product Unit of Microsoft. I am currently working on the LINQ project with specific responsibility for DLinq. Previously, I have been in a PM in SQL Server working on ObjectSpaces and DataSet. In pre-MS life, I have worked for companies ranging from startup to IBM on a wide range of software projects. Before I started working, I did M.S.E.E. and Ph.D. (CSE) from the University of Notre Dame and B.Tech. E.E. from IIT Bombay, India.

Search

This Blog

Syndication

Page view tracker