Partial Classes in C#

后端 未结 20 2814
广开言路
广开言路 2021-02-19 08:25

Are there are good uses of Partial Classes outside the webforms/winforms generated code scenarios? Or is this feature basically to support that?

20条回答
  •  执笔经年
    2021-02-19 08:38

    Anywhere you'd have used #region sections before probably makes more sense as separate files in partial classes.

    I personally use partial classes for large classes where static members go in one file and instance members go in the other one.

提交回复
热议问题