Guard.IsNull 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
IsNull<T>(Nullable<T>, String) |
Asserts that the input value is |
IsNull<T>(T, String) |
Asserts that the input value is |
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
.