Class ObjectSerializerFactory
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Framework.Serialization.Internal
Assembly: EPiServer.Framework.dll
Version: 11.20.7Syntax
[ServiceConfiguration(typeof(IObjectSerializerFactory), Lifecycle = ServiceInstanceScope.Singleton)]
public class ObjectSerializerFactory : IObjectSerializerFactory
Constructors
ObjectSerializerFactory(IEnumerable<ServiceAccessor<IObjectSerializer>>)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the ObjectSerializerFactory class.
Declaration
public ObjectSerializerFactory(IEnumerable<ServiceAccessor<IObjectSerializer>> serializers)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ServiceAccessor<IObjectSerializer>> | serializers |
Methods
GetSerializer(String)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the serializer for the given content type.
Declaration
public virtual 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(IObjectSerializer)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Registers an IObjectSerializer for a given content type.
Declaration
public void RegisterSerializer(IObjectSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
IObjectSerializer | serializer | The serializer. |
Remarks
This overrides any existing serializer.
RegisterSerializer(ServiceAccessor<IObjectSerializer>)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Registers an IObjectSerializer for all content types that the serializer specifies in HandledContentTypes.
Declaration
public void RegisterSerializer(ServiceAccessor<IObjectSerializer> accessor)
Parameters
Type | Name | Description |
---|---|---|
ServiceAccessor<IObjectSerializer> | accessor | The accessor. |
Remarks
This replaces any existing serializer.
RegisterSerializer(String, IObjectSerializer)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Registers an IObjectSerializer for a given content type.
Declaration
public void RegisterSerializer(string contentType, IObjectSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | The content type to handle. |
IObjectSerializer | serializer | The serializer. |
Remarks
This overrides any existing serializer.
RegisterSerializer(String, ServiceAccessor<IObjectSerializer>)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Registers an IObjectSerializer for a given content type.
Declaration
public void RegisterSerializer(string contentType, ServiceAccessor<IObjectSerializer> accessor)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | The content type to handle. |
ServiceAccessor<IObjectSerializer> | accessor | The creator function. |