Partial Class vs Extension Method

前端 未结 9 1821
無奈伤痛
無奈伤痛 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:31

    Partial Class - 
    

    split the definition of a class or a struct, or an interface over two or more source files

    Extension Method  
    

    Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type

提交回复
热议问题