I would like to display 'reason not explicited' if the user doesn't fill this field or the user input if he fills it. With this code, I don't understand why but even if I fill the field, it is going to display 'reason not explicited'.
private string reason;
public string Reason
{
get
{
return this.reason;
}
set
{
if (string.IsNullOrEmpty(this.Reason))
this.reason = "reason not explicited";
else this.reason = value;
}
}
[Pure]
public static bool IsNullOrEmpty(String value) {
return (value == null || value.Length == 0);
}
if (string.IsNullOrEmpty(value)) this.reason = "reason not explicited" ...;