Class EventSerializer
Represents an implementation of IEventSerializer.
[Singleton]
public class EventSerializer : IEventSerializer
- Inheritance
-
EventSerializer
- Implements
- Inherited Members
Constructors
EventSerializer(IClientArtifactsProvider, IClientArtifactsActivator, IEventTypes, JsonSerializerOptions)
Initializes a new instance of the EventSerializer class.
public EventSerializer(IClientArtifactsProvider clientArtifacts, IClientArtifactsActivator artifactActivator, IEventTypes eventTypes, JsonSerializerOptions serializerOptions)
Parameters
clientArtifactsIClientArtifactsProviderOptional IClientArtifactsProvider for the client artifacts.
artifactActivatorIClientArtifactsActivatorIServiceProvider for resolving instances.
eventTypesIEventTypesIEventTypes for resolving event types.
serializerOptionsJsonSerializerOptionsThe common
.
Methods
Deserialize(AppendedEvent)
Get the deserialized content from an AppendedEvent.
public Task<object> Deserialize(AppendedEvent @event)
Parameters
eventAppendedEventAppendedEvent to get content from.
Returns
Deserialize(Type, JsonObject)
Deserialize a JSON representation of an event to a specific type.
public Task<object> Deserialize(Type type, JsonObject json)
Parameters
typeTypeType to deserialize to.
jsonJsonObjectJSON to deserialize.
Returns
Serialize(object)
Serialize an event to JSON.
public Task<JsonObject> Serialize(object @event)
Parameters
eventobjectThe event instance to serialize.
Returns
- Task<JsonObject>
Serialized JSON.