Inside my .NET classes I access my properties and members through this. What is the difference if I access them without using this.
public class Test
{
private string _test;
public Test()
{
this.Test = "test";
// vs.
Test = "test";
// and
this._test = "test";
// vs.
_test = "test";
}
public string Test { get; set; }
}
There’s no difference for the compiler at all. Use whatever is more readable. I prefer using
thisto show that this is a field/property instead of a local variable.