Auto property
public class Genre
{
private string _name;
public string Name
{
get
{
return this._name;
}
set
{
this._name = value;
}
}
}
public class Genre
{
private string _name; // This is the backing field
public string Name // This is your property
{
get => _name;
set => _name = value;
}
}
Scrivere prop e te la prepara l’ide
If you get a stack overflow you might have a loop. The variable and the Property need to have different names.