Guard.IsOfType 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
IsOfType(Object, Type, String) |
Asserts that the input value is of a specific type. |
IsOfType<T>(Object, String) |
Asserts that the input value is of a specific type. |
IsOfType(Object, Type, String)
Asserts that the input value is of a specific type.
public static void IsOfType (object value, Type type, string name);
static member IsOfType : obj * Type * string -> unit
Public Shared Sub IsOfType (value As Object, type As Type, name As String)
Parameters
- type
- Type
The type to look for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the type of value
is not the same as type
.
Applies to
IsOfType<T>(Object, String)
Asserts that the input value is of a specific type.
public static void IsOfType<T> (object value, string name);
static member IsOfType : obj * string -> unit
Public Shared Sub IsOfType(Of T) (value As Object, name As String)
Type Parameters
- T
The type of the input value.
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is not of type T
.