Partial Classes in C#

后端 未结 20 3004
时光说笑
时光说笑 2021-02-19 07:59

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:43

    I just found a use for partial classes. I have a [DataContract] class that I use to pass data to the client. I wanted the client to be able to display the class in a specific way (text output). so I created a partial class and overrode the ToString method.

提交回复
热议问题