Set a default value to a property
- by BrunoLM
Is it possible to set a default value without the body of a property? Maybe through annotations?
[SetTheDefaultValueTo(true)]
public bool IsTrue { get; set; }
[SetTheDefaultValueTo(false)]
public bool IsFalse { get; set; }
public void Something()
{
var isTrue = this.IsTrue;
var isFalse = this.IsFalse;
}