c# variable get set default value code example
Example 1: c# auto property set default value
public int X { get; set; } = x; // C# 6 or higher
Example 2: get set c#
private string name;
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}