Is it possible to set a default value without the body of a property? Preferably with annotations.
[SetTheDefaultValueTo(true)] public bool IsTrue { get; set; }
In this very specific example, you sort of can:
public bool IsFalse { get; set; } public bool IsTrue { get { return !IsFalse; } set { IsFalse = !value; } } public void Something() { var isTrue = this.IsTrue; var isFalse = this.IsFalse; }
But, in general, no.