You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspired by ArgumentNullException.ThrowIfNull(object) and ArgumentException.ThrowIfNullOrEmpty from #62628. string.IsNullOrWhiteSpace(text) is a frequent check, especially in Web/Console projects.
Now:
if (string.IsNullOrWhiteSpace(input))
{
throw new ArgumentException($"{nameof(input)} must contain value.");
}
Background and motivation
Inspired by
ArgumentNullException.ThrowIfNull(object)
andArgumentException.ThrowIfNullOrEmpty
from #62628.string.IsNullOrWhiteSpace(text)
is a frequent check, especially in Web/Console projects.Now:
API Proposal
API Usage
Alternative Designs
Define it as an extension method
Risks
No response
The text was updated successfully, but these errors were encountered: