How to handle a class you want to extend which is sealed in the .NET library?

前端 未结 7 1462
礼貌的吻别
礼貌的吻别 2021-01-02 02:54

I was reading somewhere about how to handle the issue of wanting to extend a sealed class in the .NET Framework library.

This is often a common and useful task to do

7条回答
  •  醉话见心
    2021-01-02 03:34

    How about extension methods? You can "add" additional methods that way, without having to deal with the inheritance restriction.

提交回复
热议问题