Partial Class vs Extension Method

前端 未结 9 1693
無奈伤痛
無奈伤痛 2021-02-01 02:09

I dont have much experience of using these 2 ways to extend a class or create extension methods against a class. By looking others work, I have a question here.

I saw pe

9条回答
  •  故里飘歌
    2021-02-01 02:21

    You can use extension methods on a NULL instance but not instance methods (of partial classes or otherwise). This is a consequence of extension methods actually being static.

提交回复
热议问题