Technically Resharper is correct in that the “else” is unnecessary, I prefer the former version though as the intent is more obvious.
Having said that, I’d rather go with:
return attr != null ? attr.Value : string.Empty;
Technically Resharper is correct in that the “else” is unnecessary, I prefer the former version though as the intent is more obvious.
Having said that, I’d rather go with:
return attr != null ? attr.Value : string.Empty;