Guard.IsAssignableToType Method

Definition

Overloads

IsAssignableToType(Object, Type, String)

Asserts that the input value can be assigned to a specified type.

IsAssignableToType<T>(Object, String)

Asserts that the input value can be assigned to a specified type.

IsAssignableToType(Object, Type, String)

Asserts that the input value can be assigned to a specified type.

public static void IsAssignableToType (object value, Type type, string name);
static member IsAssignableToType : obj * Type * string -> unit
Public Shared Sub IsAssignableToType (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 value can't be assigned to type.

Applies to

IsAssignableToType<T>(Object, String)

Asserts that the input value can be assigned to a specified type.

public static void IsAssignableToType<T> (object value, string name);
static member IsAssignableToType : obj * string -> unit
Public Shared Sub IsAssignableToType(Of T) (value As Object, name As String)

Type Parameters

T

The type to check the input value against.

Parameters

value
Object

The input Object to test.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value can't be assigned to type T.

Applies to