Class EventSerializer
Represents an implementation of IEventSerializer.
[Singleton]
public class EventSerializer : IEventSerializer
- Inheritance
-
EventSerializer
- Implements
- Inherited Members
Constructors
EventSerializer(IClientArtifactsProvider, IServiceProvider, IEventTypes, JsonSerializerOptions)
Initializes a new instance of the EventSerializer class.
public EventSerializer(IClientArtifactsProvider clientArtifacts, IServiceProvider serviceProvider, IEventTypes eventTypes, JsonSerializerOptions serializerOptions)
Parameters
clientArtifacts
IClientArtifactsProviderOptional IClientArtifactsProvider for the client artifacts.
serviceProvider
IServiceProviderIServiceProvider for resolving instances.
eventTypes
IEventTypesIEventTypes for resolving event types.
serializerOptions
JsonSerializerOptionsThe common
.
Methods
Deserialize(AppendedEvent)
Deserialize an AppendedEvent to its actual type.
public Task<object> Deserialize(AppendedEvent @event)
Parameters
event
AppendedEventAppendedEvent to deserialize.
Returns
Deserialize(Type, ExpandoObject)
Deserialize a JSON representation of an event to a specific type.
public Task<object> Deserialize(Type type, ExpandoObject expandoObject)
Parameters
type
TypeType to deserialize to.
expandoObject
ExpandoObjectObject to deserialize.
Returns
Deserialize(Type, JsonObject)
Deserialize a JSON representation of an event to a specific type.
public Task<object> Deserialize(Type type, JsonObject json)
Parameters
type
TypeType to deserialize to.
json
JsonObjectJSON to deserialize.
Returns
Serialize(object)
Serialize an event to JSON.
public Task<JsonObject> Serialize(object @event)
Parameters
event
objectThe event instance to serialize.
Returns
- Task<JsonObject>
Serialized JSON.