Use of “this” keyword in formal parameters for static methods in C#

I’ve come across several instances of C# code like the following:

public static int Foo(this MyClass arg)

I haven’t been able to find an explanation of what the this keyword means in this case. Any insights?

7 Answers
7

Leave a Comment