AArnott / Validation

Method input validation and runtime checks that report errors or throw exceptions when failures are detected.
Microsoft Public License
131 stars 22 forks source link

Requires: Return parameter value for string null/white-space check #72

Closed n-ski closed 3 years ago

n-ski commented 3 years ago

Pretty straightforward change, allows one to do

_someField = Requires.NotNullOrEmpty(stringParam, nameof(stringParam));

instead of

Requires.NotNullOrEmpty(stringParam, nameof(stringParam));
_someField = stringParam;
AArnott commented 3 years ago

This is a good change, but it's a binary breaking change, so I think we'll have to save it for a 3.0 release.