Is it possible to set a default value without the body of a property? Preferably with annotations.
[SetTheDefaultValueTo(true)] public bool IsTrue { get; set; }
Assign the default property value in the class constructor.
class MyClass { public MyClass() { IsTrue = true; IsFalse = false; } public bool IsTrue { get; set; } public bool IsFalse { get; set; } [...] public void Something() { var isTrue = this.IsTrue; var isFalse = this.IsFalse; } }