how to assign default value in a property in C# code example Example: c# object default property value public int X { get; set; } = x; // C# 6 or higher