this is just a pointer to your class. Through it you can see a listing of the properties and methods available in it.
For the above case, you can write the second example without using this. Although you can use it, it is not required in your code.
If you want to know more about this pointer, see this link: Pointer this
Regarding the use of properties with underscore, it is usually used when creating a property as the example below:
private string _nome;
public string Nome
{
get { return _nome; }
set { _nome = value; }
}
In this example you create a public and a private access property where you do not want to expose your access. By default, private property is written with the underscore.
This type of property is called a complete property and is usually used when you want to execute some code in the get and set actions.
If you want to know more about property types, see the link below.
Types of Properties in C#
Put the reference on that please, that wasn’t you who said it! I just read it.
– novic
Thank you for the comment, corrected.
– Thiago Pires
This answer is correct. the other is not completely wrong, but creates confusion and indicates things that are not recommended.
– Maniero