I was wondering if its possible to change the default “program” class that gets created for any console application to a partial class.
I want to do this because I want better organisation rather than have all methods in 1 file categorized by region. It would make more sense for me to have certain method categories sitting in separate files.
My understanding of a partial class is that it is a class definition in multiple files that during a compile merges the class files into 1 class unit.
I could be wrong, or there could be a better way for me to achieve better organisational structure. Any suggestions would help, and thanks
You certainly can do that – but it sounds to me like you’d be better off splitting your code into multiple classes. If you’ve got multiple method “categories” those categories may well be natural class boundaries.
Generally speaking, the entry point class should be fairly small. That’s not always the case, but it’s a good rule of thumb. Usually its only purpose is to get the rest of the program running.