Guard
/ThrowHelper
vs <Exception>.Throw*
methods
#851
Unanswered
Rabadash8820
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
-
Hello! I only just discovered this repo today while learning about the
Guard
APIs. I had previously come across the<Exception>.Throw*
methods in .NET 7+, so I'm now a little confused about when to use which, since both of these APIs are apparently maintained by MS. Is it basically thatGuard
andThrowHelper
have been around longer, so their APIs are more robust, while the newer.Throw*
methods will be the recommendation going forward?As an example, if I'm tarting .NET 7+, when would I use
Guard.IsNotNull
vsArgumentNullException.ThrowIfNull
?Beta Was this translation helpful? Give feedback.
All reactions