Should ContributorName use string.IsNullOrWhiteSpace() instead of string.IsNullOrEmpty()? #1053
Unanswered
hoseinipeyrov
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The
ContributorNamevalue object currently validates input using:string.IsNullOrEmpty(name)This allows whitespace-only values such as " ", "\t", or "\n" to pass validation, as long as they do not exceed MaxLength.
Was this intentional in the design, or should
string.IsNullOrWhiteSpace()be preferred here to ensure whitespace-only names are rejected?In most domain models, contributor names consisting only of whitespace are considered invalid.
All reactions