Method GetSerializerFor
GetSerializerFor(Type)
Get the value serializer declared for the given type.
public static ValueSerializer GetSerializerFor(Type type)
Parameters
typeTypeThe value type to serialize
Returns
- ValueSerializer
The value serializer associated with the given type
GetSerializerFor(PropertyDescriptor)
Get the value serializer declared for the given property. ValueSerializer can be overriden by an attribute on the property declaration.
public static ValueSerializer GetSerializerFor(PropertyDescriptor descriptor)
Parameters
descriptorPropertyDescriptorPropertyDescriptor for the property to be serialized
Returns
- ValueSerializer
A value serializer associated with the given property
GetSerializerFor(Type, IValueSerializerContext)
Get the value serializer declared for the given type. This version should be called whenever the caller has a IValueSerializerContext to ensure that the correct value serializer is returned for the given context.
public static ValueSerializer GetSerializerFor(Type type, IValueSerializerContext context)
Parameters
typeTypeThe value type to serialize
contextIValueSerializerContextContext information
Returns
- ValueSerializer
The value serializer associated with the given type
GetSerializerFor(PropertyDescriptor, IValueSerializerContext)
Get the value serializer declared for the given property. ValueSerializer can be overriden by an attribute on the property declaration. This version should be called whenever the caller has a IValueSerializerContext to ensure that the correct value serializer is returned for the given context.
public static ValueSerializer GetSerializerFor(PropertyDescriptor descriptor, IValueSerializerContext context)
Parameters
descriptorPropertyDescriptorPropertyDescriptor for the property to be serialized
contextIValueSerializerContextContext information
Returns
- ValueSerializer
A value serializer associated with the given property