When should the keyword ‘this’ be used within C# class definitions?
Is it standard to use the form ‘this.Method()’ from within class? Or to just use ‘Method()’? I have seen both, and usually go with the second choice, but I would like to learn more about this subject.
Most of the time it is redundant and can be omitted; a few exceptions:
Foo() : this('bar') {}this.foo = foo;etcthis.SomeMethod();(where defined aspublic static SomeMethod(this Foo foo) {...})Helper.DoSomething(this);