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
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I only just discovered this repo today while learning about the
GuardAPIs. 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 thatGuardandThrowHelperhave 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.IsNotNullvsArgumentNullException.ThrowIfNull?Beta Was this translation helpful? Give feedback.
All reactions