Guard.IsNull Method

Definition

Overloads

IsNull<T>(Nullable<T>, String)

Asserts that the input value is null.

IsNull<T>(T, String)

Asserts that the input value is null.

IsNull<T>(Nullable<T>, String)

Asserts that the input value is null.

public static void IsNull<T> (T? value, string name) where T : struct;
static member IsNull : Nullable<'T (requires 'T : struct)> * string -> unit (requires 'T : struct)
Public Shared Sub IsNull(Of T As Structure) (value As Nullable(Of T), name As String)

Type Parameters

T

The type of nullable value type being tested.

Parameters

value
Nullable<T>

The input value to test.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is not null.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to

IsNull<T>(T, String)

Asserts that the input value is null.

public static void IsNull<T> (T? value, string name) where T : class;
static member IsNull : 'T * string -> unit (requires 'T : null)
Public Shared Sub IsNull(Of T As Class) (value As T, name As String)

Type Parameters

T

The type of reference value type being tested.

Parameters

value
T

The input value to test.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is not null.

Applies to