0

I was wondering if there is a best practice method for splitting up a class in partial classes?

I am seperating a DeclarationController file in seperate files. Do I create partial classes per functionality or per subject / class?

For example: I tried seperating all upload functionalities for several types of declaration. But I was thinking it might be better to sort on all subdeclaration functionalities.

Any help with best practices for partial classes is welcome!

Thank you

Michael A
  • 1
  • 2
  • 1
    tl;dr: you don't, unless you have code generation tools that happen to need to write into the same class (forms, DTOs/entities) or when you have classes existing of thousands of lines of code that you can't refactor right now. See [duplicate](https://stackoverflow.com/questions/3601901/when-is-it-appropriate-to-use-c-sharp-partial-classes). – CodeCaster May 11 '23 at 11:36

0 Answers0