Throw.IfArgument(Boolean, String, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Throws ArgumentException with the given parameter name and optional message if the given Boolean value is true.
public static void IfArgument (bool isInvalid, string paramName, string message = default);
static member IfArgument : bool * string * string -> unit
Public Shared Sub IfArgument (isInvalid As Boolean, paramName As String, Optional message As String = Nothing)
Parameters
- isInvalid
- Boolean
The flag to test. This method throws if it's true and does nothing if it's false.
- paramName
- String
The name of the parameter being validated. This is passed to the ArgumentException constructor.
- message
- String
An optional error message to include in the ArgumentException. The default message is "Invalid argument."
Applies to
Azure SDK for .NET