Guard.IsOfType Method

Definition

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

value
Object

The input Object to test.

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

value
Object

The input Object to test.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is not of type T.

Applies to