Class EventFactory<TAuthenticationToken>
A factory implementing IEventDeserialiser<TAuthenticationToken> and IEventBuilder<TAuthenticationToken>
Inheritance
Inherited Members
Namespace: Cqrs.EventStore
Assembly: Cqrs.EventStore.dll
Syntax
public class EventFactory<TAuthenticationToken> : IEventBuilder<TAuthenticationToken>, IEventDeserialiser<TAuthenticationToken>
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The System.Type of the authentication token. |
Methods
CreateClientConnectedEvent(String)
Create an EventStore.ClientAPI.EventData that notifies people a client has connected.
Declaration
public EventData CreateClientConnectedEvent(string clientName)
Parameters
Type | Name | Description |
---|---|---|
System.String | clientName | The name of the client that has connected. |
Returns
Type | Description |
---|---|
EventStore.ClientAPI.EventData |
Implements
CreateFrameworkEvent(IEvent<TAuthenticationToken>)
Create an EventStore.ClientAPI.EventData with the provided eventData
.
Declaration
public EventData CreateFrameworkEvent(IEvent<TAuthenticationToken> eventData)
Parameters
Type | Name | Description |
---|---|---|
IEvent<TAuthenticationToken> | eventData | The IEvent<TAuthenticationToken> to add to the EventStore.ClientAPI.EventData. |
Returns
Type | Description |
---|---|
EventStore.ClientAPI.EventData |
Implements
CreateFrameworkEvent(String)
Create an EventStore.ClientAPI.EventData from the provided eventDataBody
.
Declaration
public EventData CreateFrameworkEvent(string eventDataBody)
Parameters
Type | Name | Description |
---|---|---|
System.String | eventDataBody | A JSON string of serialised data. |
Returns
Type | Description |
---|---|
EventStore.ClientAPI.EventData |
Implements
CreateFrameworkEvent(String, IEvent<TAuthenticationToken>)
Create an EventStore.ClientAPI.EventData with the provided eventData
.
Declaration
public EventData CreateFrameworkEvent(string type, IEvent<TAuthenticationToken> eventData)
Parameters
Type | Name | Description |
---|---|---|
System.String | type | The name of the System.Type of the target object the serialised data is. |
IEvent<TAuthenticationToken> | eventData | The IEvent<TAuthenticationToken> to add to the EventStore.ClientAPI.EventData. |
Returns
Type | Description |
---|---|
EventStore.ClientAPI.EventData |
Implements
CreateFrameworkEvent(String, String)
Create an EventStore.ClientAPI.EventData from the provided eventDataBody
.
Declaration
public EventData CreateFrameworkEvent(string type, string eventDataBody)
Parameters
Type | Name | Description |
---|---|---|
System.String | type | The name of the System.Type of the target object the serialised data is. |
System.String | eventDataBody | A JSON string of serialised data. |
Returns
Type | Description |
---|---|
EventStore.ClientAPI.EventData |
Implements
Deserialise(RecordedEvent)
Deserialise the provided eventData
into an IEvent<TAuthenticationToken>.
Declaration
public IEvent<TAuthenticationToken> Deserialise(RecordedEvent eventData)
Parameters
Type | Name | Description |
---|---|---|
EventStore.ClientAPI.RecordedEvent | eventData | The EventStore.ClientAPI.RecordedEvent to Deserialise. |
Returns
Type | Description |
---|---|
IEvent<TAuthenticationToken> |
Implements
Deserialise(ResolvedEvent)
Deserialise the provided notification
into an IEvent<TAuthenticationToken>.
Declaration
public IEvent<TAuthenticationToken> Deserialise(ResolvedEvent notification)
Parameters
Type | Name | Description |
---|---|---|
EventStore.ClientAPI.ResolvedEvent | notification | The EventStore.ClientAPI.ResolvedEvent to Deserialise. |
Returns
Type | Description |
---|---|
IEvent<TAuthenticationToken> |
Implements
GetSerialisationSettings()
Gets the Newtonsoft.Json.JsonSerializerSettings used while Deserialising.
Declaration
public JsonSerializerSettings GetSerialisationSettings()
Returns
Type | Description |
---|---|
Newtonsoft.Json.JsonSerializerSettings |