Ensure
Provides methods for ensuring that method arguments meet specific criteria. This class provides a consistent way to validate arguments and throw appropriate exceptions.Syntax
Inheritance
Methods
ArgumentNotNull
Parameters
- argument object: The argument to validate.
- argumentName string: The name of the argument being validated.
Exceptions
[ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): Thrown whenargumentis null.
ArgumentNotNullOrWhiteSpace
Parameters
- argument string: The argument to validate.
- argumentName string: The name of the argument being validated.
Exceptions
[ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception): Thrown whenargumentis null or whitespace.