Interface IObjectSerializerFactory
Defines a factory service responsible for creating IObjectSerializer instances used to serialize objects that should be passed to the UI.
Namespace: EPiServer.Framework.Serialization
Assembly: EPiServer.Framework.dll
Version: 11.20.7Syntax
public interface IObjectSerializerFactory
Methods
GetSerializer(String)
Gets the IObjectSerializer that is registered for the provided content type.
Declaration
IObjectSerializer GetSerializer(string contentType)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | The content type. |
Returns
Type | Description |
---|---|
IObjectSerializer | An IObjectSerializer for the given content type or null if no serializer is registered for the content type. |
RegisterSerializer(String, ServiceAccessor<IObjectSerializer>)
Registers an IObjectSerializer for a given content type.
Declaration
void RegisterSerializer(string contentType, ServiceAccessor<IObjectSerializer> accessor)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | The content type to handle. |
ServiceAccessor<IObjectSerializer> | accessor | The accessor delegate. |