Override a virtual method in a partial class

前端 未结 5 732
暗喜
暗喜 2021-01-18 01:47

I am currently working with the nopCommerce source code and trying my best to avoid editing the source at all, but instead using partial classes and plugins that are separat

5条回答
  •  清歌不尽
    2021-01-18 02:26

    The problem is that you're still technically in the same class. Partial classes are essentially combined when compiling, so what it sees is both methods defined in the same class. If you used a subclass, you could do that, but you can't have the method defined twice in the same class.

提交回复
热议问题