Generic and more specific Guards? #233
richardvaldiviesomacias
started this conversation in
Ideas
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.
-
Good morning
This is my first time creating a discussion on any repository here on Github, so I apologize in advance if I am not doing this in any particular format.
I was wondering if it is possible to have a generic version of some of the Guard methods. Sometimes I want to throw an exception that is not ArgumentNullException when some value that was created in the body of the code is null. (eg I have an API call and that call returns an invalid email and I want to throw InvalidEmailFormatException)
I was thinking something like:
so I can pass a different exception.
Some cases can be cover as well with something more specific like:
Beta Was this translation helpful? Give feedback.
All reactions