Method GetSerializerFor
GetSerializerFor(Type)
Get the value serializer declared for the given type.
public static ValueSerializer GetSerializerFor(Type type)
Parameters
type
TypeThe 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
descriptor
PropertyDescriptorPropertyDescriptor 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
type
TypeThe value type to serialize
context
IValueSerializerContextContext 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
descriptor
PropertyDescriptorPropertyDescriptor for the property to be serialized
context
IValueSerializerContextContext information
Returns
- ValueSerializer
A value serializer associated with the given property