Open sandboxFocus

Method Convert

Convert(object, Type)

Converts a value into a given target type.

Declaration
object Convert(object value, Type targetType)
Parameters
Type Name Description
object value

The value to be converted.

Type targetType

The target type.

Returns
Type Description
object

The value converted to targetType.

Remarks

This method allows for additional flexibility if the serialization-time type is not equal to the deserialization-time type. The current method is invoked at deserialization time to perform the conversion.