set default value on property c# code example Example: c# auto property set default value Click to copypublic int X { get; set; } = x; // C# 6 or higher