Guard.IsAssignableToType 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
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
- 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
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
can't be assigned to type T
.