The Darkside

Shedding light on things and stuff

 
  Home :: Contact :: Syndication  :: Login
  83 Posts :: 0 Stories :: 57 Comments :: 2 Trackbacks

Ads

 

Donate via PayPal...

...if you feel the site helped.

Archives

Post Categories

Open Source Projects

Other Blogs

This is just a tip for anyone using GeneratorStudio or any other code generator for their ActiveRecord classes (or any other classes, for that matter).

I generally have my templates set up to generate my files with the name "<TABLENAME>.Generated.cs" or something similar. In addition to this naming convention, I also make sure that my generated classes are marked as partial classes, and then I do all custom code, like additional "Find" methods methods, etc, in files named "<TABLENAME>.cs".

This way, when you need to regenerate anything, you can be comfortable with overwriting all the classes that are "<TABLENAME>.Generated.cs" without worrying about overwriting code that you don't want to lose.

You can go one step further and drop the generated files in their own folder - I name my "Generated", and I change the property named "Namespace Provider" on the folder to false.

posted on Sunday, February 15, 2009 7:28 PM
Comments have been closed on this topic.