Override a virtual method in a partial class

前端 未结 5 730
暗喜
暗喜 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:18

    You can use partial class to split the code of a class in multiple, but you can not split a single method in 2 partial classes. You need to have method in only one place. If you want to extent the functionality then look for another methods like sub-classing or composition etc. which ever suits your scenario.

提交回复
热议问题