What is the use of a partial class?

前端 未结 10 883
梦谈多话
梦谈多话 2021-01-13 00:15

How can a partial class be useful in coding? Can anyone explain in detail with examples?

10条回答
  •  清酒与你
    2021-01-13 01:13

    I have seen people using partial classes to separate classes that are too large into separate files - where a better solution would be to split the class up into many separate classes.

    I consider it an anti-pattern to use partial classes for splitting hand written classes into separate files.

提交回复
热议问题