views:

86

answers:

3

Hi,

I have a datalayer.cs file that was generated using a code gen tool.

I am marking the class as a partial class, so I can create another file with my own hand written datalayer code.

How should I name my files?

Should I do it like this:

/data/partial/datalayer.cs /data/datalayer.cs

So when I run my codegenerator again, I just dump the file to the /partial/ folder in my source tree.

suggestions?

+3  A: 

VS uses a Filename.Designer.cs convention for generated files. You might do something similar. For example, you might have DataLayer.cs and DataLayer.Generated.cs. I personally would keep the files next to each other in the same directory to aid in discoverability.

HTH, Kent

Kent Boogaart
+1  A: 

Partial classes which are generated by the IDE when you create a Windows.Form are named like:

/mydirectory/MyFormName.cs
/mydirectory/MyFormName.Designer.cs

So I'd suggest like:

/mydirectory/datalayer.cs
/mydirectory/datalayer.autocodegen.cs
ChrisW
A: 

I personally use ClassName_Generated.cs for generated files. I personally prefer an _ to a . for the generated separator.

JaredPar