Why we use “this” in Extension Methods?

后端 未结 6 1257
遥遥无期
遥遥无期 2021-01-17 10:36

I want to ask why we use \"this\" keyword before the parameter in an extension method (C# Language)........... like this function :

    public static int ToI         


        
6条回答
  •  清酒与你
    2021-01-17 11:01

    In order to identify the method as an extension method. How else would the compiler know?

提交回复
热议问题