c# auto property set default value

C#
public int X { get; set; } = x; // C# 6 or higher
Source

Also in C#: