ThrowHelper.ThrowArgumentNullException Method

Definition

Overloads

ThrowArgumentNullException()

Throws a new ArgumentNullException.

ThrowArgumentNullException(String)

Throws a new ArgumentNullException.

ThrowArgumentNullException(String, Exception)

Throws a new ArgumentNullException.

ThrowArgumentNullException(String, String)

Throws a new ArgumentNullException.

ThrowArgumentNullException<T>()

Throws a new ArgumentNullException.

ThrowArgumentNullException<T>(String)

Throws a new ArgumentNullException.

ThrowArgumentNullException<T>(String, Exception)

Throws a new ArgumentNullException.

ThrowArgumentNullException<T>(String, String)

Throws a new ArgumentNullException.

ThrowArgumentNullException()

Throws a new ArgumentNullException.

public static void ThrowArgumentNullException ();
static member ThrowArgumentNullException : unit -> unit
Public Shared Sub ThrowArgumentNullException ()

Exceptions

Thrown with no parameters.

Applies to

ThrowArgumentNullException(String)

Throws a new ArgumentNullException.

public static void ThrowArgumentNullException (string? name);
static member ThrowArgumentNullException : string -> unit
Public Shared Sub ThrowArgumentNullException (name As String)

Parameters

name
String

The argument name.

Exceptions

Thrown with the specified parameter.

Applies to

ThrowArgumentNullException(String, Exception)

Throws a new ArgumentNullException.

public static void ThrowArgumentNullException (string? name, Exception? innerException);
static member ThrowArgumentNullException : string * Exception -> unit
Public Shared Sub ThrowArgumentNullException (name As String, innerException As Exception)

Parameters

name
String

The argument name.

innerException
Exception

The inner Exception to include.

Exceptions

Thrown with the specified parameters.

Applies to

ThrowArgumentNullException(String, String)

Throws a new ArgumentNullException.

public static void ThrowArgumentNullException (string? name, string? message);
static member ThrowArgumentNullException : string * string -> unit
Public Shared Sub ThrowArgumentNullException (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

ThrowArgumentNullException<T>()

Throws a new ArgumentNullException.

public static T ThrowArgumentNullException<T> ();
static member ThrowArgumentNullException : unit -> 'T
Public Shared Function ThrowArgumentNullException(Of T) () As T

Type Parameters

T

The type of expected result.

Returns

T

This method always throws, so it actually never returns a value.

Exceptions

Thrown with no parameters.

Applies to

ThrowArgumentNullException<T>(String)

Throws a new ArgumentNullException.

public static T ThrowArgumentNullException<T> (string? name);
static member ThrowArgumentNullException : string -> 'T
Public Shared Function ThrowArgumentNullException(Of T) (name As String) As T

Type Parameters

T

The type of expected result.

Parameters

name
String

The argument name.

Returns

T

This method always throws, so it actually never returns a value.

Exceptions

Thrown with the specified parameter.

Applies to

ThrowArgumentNullException<T>(String, Exception)

Throws a new ArgumentNullException.

public static T ThrowArgumentNullException<T> (string? name, Exception? innerException);
static member ThrowArgumentNullException : string * Exception -> 'T
Public Shared Function ThrowArgumentNullException(Of T) (name As String, innerException As Exception) As T

Type Parameters

T

The type of expected result.

Parameters

name
String

The argument name.

innerException
Exception

The inner Exception to include.

Returns

T

This method always throws, so it actually never returns a value.

Exceptions

Thrown with the specified parameters.

Applies to

ThrowArgumentNullException<T>(String, String)

Throws a new ArgumentNullException.

public static T ThrowArgumentNullException<T> (string? name, string? message);
static member ThrowArgumentNullException : string * string -> 'T
Public Shared Function ThrowArgumentNullException(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

T

This method always throws, so it actually never returns a value.

Exceptions

Thrown with the specified parameters.

Applies to