ThrowHelper.ThrowArgumentOutOfRangeException 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.
Overloads
ThrowArgumentOutOfRangeException(String, Object, String)
Throws a new ArgumentOutOfRangeException.
public static void ThrowArgumentOutOfRangeException (string? name, object? value, string? message);
static member ThrowArgumentOutOfRangeException : string * obj * string -> unit
Public Shared Sub ThrowArgumentOutOfRangeException (name As String, value As Object, message As String)
Parameters
- name
- String
The argument name.
- value
- Object
The current argument value.
- message
- String
The message to include in the exception.
Exceptions
Thrown with the specified parameters.
Applies to
ThrowArgumentOutOfRangeException(String, String)
Throws a new ArgumentOutOfRangeException.
public static void ThrowArgumentOutOfRangeException (string? name, string? message);
static member ThrowArgumentOutOfRangeException : string * string -> unit
Public Shared Sub ThrowArgumentOutOfRangeException (name As String, message As String)
Parameters
- name
- String
The argument name.
- message
- String
The message to include in the exception.
Exceptions
Thrown with the specified parameters.
Applies to
ThrowArgumentOutOfRangeException(String)
Throws a new ArgumentOutOfRangeException.
public static void ThrowArgumentOutOfRangeException (string? name);
static member ThrowArgumentOutOfRangeException : string -> unit
Public Shared Sub ThrowArgumentOutOfRangeException (name As String)
Parameters
- name
- String
The argument name.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowArgumentOutOfRangeException()
Throws a new ArgumentOutOfRangeException.
public static void ThrowArgumentOutOfRangeException ();
static member ThrowArgumentOutOfRangeException : unit -> unit
Public Shared Sub ThrowArgumentOutOfRangeException ()
Exceptions
Thrown with no parameters.
Applies to
ThrowArgumentOutOfRangeException(String, Exception)
Throws a new ArgumentOutOfRangeException.
public static void ThrowArgumentOutOfRangeException (string? name, Exception? innerException);
static member ThrowArgumentOutOfRangeException : string * Exception -> unit
Public Shared Sub ThrowArgumentOutOfRangeException (name As String, innerException As Exception)
Parameters
- name
- String
The argument name.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowArgumentOutOfRangeException<T>()
Throws a new ArgumentOutOfRangeException.
public static T ThrowArgumentOutOfRangeException<T> ();
static member ThrowArgumentOutOfRangeException : unit -> 'T
Public Shared Function ThrowArgumentOutOfRangeException(Of T) () As T
Type Parameters
- T
The type of expected result.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with no parameters.
Applies to
ThrowArgumentOutOfRangeException<T>(String)
Throws a new ArgumentOutOfRangeException.
public static T ThrowArgumentOutOfRangeException<T> (string? name);
static member ThrowArgumentOutOfRangeException : string -> 'T
Public Shared Function ThrowArgumentOutOfRangeException(Of T) (name As String) As T
Type Parameters
- T
The type of expected result.
Parameters
- name
- String
The argument name.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowArgumentOutOfRangeException<T>(String, Exception)
Throws a new ArgumentOutOfRangeException.
public static T ThrowArgumentOutOfRangeException<T> (string? name, Exception? innerException);
static member ThrowArgumentOutOfRangeException : string * Exception -> 'T
Public Shared Function ThrowArgumentOutOfRangeException(Of T) (name As String, innerException As Exception) As T
Type Parameters
- T
The type of expected result.
Parameters
- name
- String
The argument name.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowArgumentOutOfRangeException<T>(String, String)
Throws a new ArgumentOutOfRangeException.
public static T ThrowArgumentOutOfRangeException<T> (string? name, string? message);
static member ThrowArgumentOutOfRangeException : string * string -> 'T
Public Shared Function ThrowArgumentOutOfRangeException(Of T) (name As String, message As String) As T
Type Parameters
- T
The type of expected result.
Parameters
- name
- String
The argument name.
- message
- String
The message to include in the exception.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameters.
Applies to
ThrowArgumentOutOfRangeException<T>(String, Object, String)
Throws a new ArgumentOutOfRangeException.
public static T ThrowArgumentOutOfRangeException<T> (string? name, object? value, string? message);
static member ThrowArgumentOutOfRangeException : string * obj * string -> 'T
Public Shared Function ThrowArgumentOutOfRangeException(Of T) (name As String, value As Object, message As String) As T
Type Parameters
- T
The type of expected result.
Parameters
- name
- String
The argument name.
- value
- Object
The current argument value.
- message
- String
The message to include in the exception.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameters.