score:2

Accepted answer

i think that replacing mslinqtosqlgenerator with something else is the cleanest solution and it might be done in several ways. you could, for example,

  1. use a tool like t4 toolbox: linq to sql classes generator or reegenerator and modify the provided template to suit your needs. that's probably the easiest way.

  2. generate the code with t4 using a custom template. you will need to create a t4 template which would use xml data from .dbml file. you'd probably need to disable dbml code generation by setting the custom tool property to blank. the disadvantage is you will need to run t4 generation each time after modifying .dbml file.

  3. create a custom tool to generate the code for you using xml data from .dbml file and some templating solution (t4 or xslt, perhaps). this approach could arguably be the most flexible one, the only disadvantage is that you'll have to use the custom tool on every developers' machine.

i'm not sure what's optimal for your situation, but i'd probably consider using t4 toolbox first. the t4 template it uses is quite standard and can easily be modified if necessary.


Related Query

More Query from same tag