PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Serialization Namespace / Reference­Type­Serializer Class / Reference­Type­Serializer Methods / Reference­Type­Serializer.​Convert Method

ReferenceTypeSerializer.Convert Method

Converts a value into a given target type.

Namespace:  PostSharp.Serialization
Assembly:  PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
Syntax
C#
public virtual Object Convert(
	Object value,
	Type targetType
)

Parameters

value
Type: System.Object
Value to be converted.
targetType
Type: System.Type
target type.

Return Value

Type: Object
The value converted to targetType.

Implements

ISerializer.Convert(Object, Type)
Remarks

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

See Also