PostSharpAPI ReferencePost­Sharp.​SerializationSerializer­Factory­ProviderGet­Surrogate­Type
Open sandboxFocus

SerializerFactoryProvider.GetSurrogateType Method

GetSurrogateType(Type)

Gets the surrogate type for a given object type.

Declaration
public virtual Type GetSurrogateType(Type objectType)
Parameters
Type Name Description
Type objectType

Type of the object being serialized.

Returns
Type Description
Type

The surrogate type for objectType, or null (or objectType) is objectType does not require a surrogate type.

Implements
ISerializerFactoryProvider.GetSurrogateType(Type)
Remarks

This method is called only during serialization. The surrogate type is the type whose name will be serialized; therefore, it will also be the type that will be deserialized.

It is not the responsibility of this class to call the next provider (NextProvider).