Maybe a bit silly question, but in one of my projects I needed an enum and I suddenly wondered what would
be the best place for it to write it in a file. Should it be in a .cs file of his own or could I place it in the
class file where it is mostly used?
Thanks in advance for any enlightment.
Jump to Post
For smaller projects I place enums in a project-level Enumerations.cs file. For larger projects I tend to break things down into folders where each folder holds related stuff and might have its own Enumerations.cs file.
For tiny projects or strongly self-contained classes where only the class needs access to it, …
All 3 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.