I have a set of properties and need to provide a default values for them. Sure I can do the following in getter:
public string MyProp {
get {
if(!string.IsNulOrEmpty(_myProp))
return _myProp;
else
return "Default";
}
But I`d like it to look like
[DefaultValue("Default")]
public string Processes
{
get { return _processes; }
Is there a good way to do it with attributes? I`ve spent some time to look for some attribute or a way to do this but found nothing.