Class EventService<TAuthenticationToken>
A WCF System.ServiceModel.ServiceContractAttribute that provides read-only access to IEventStore<TAuthenticationToken> IEvent<TAuthenticationToken> raised with the same CorrelationId.
Inheritance
Inherited Members
Namespace: Cqrs.Services
Assembly: Cqrs.dll
Syntax
public abstract class EventService<TAuthenticationToken> : IEventService<TAuthenticationToken>
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The System.Type of authentication token. |
Constructors
EventService(IEventStore<TAuthenticationToken>, ILogger, ICorrelationIdHelper, IAuthenticationTokenHelper<TAuthenticationToken>)
Instantiates a new instance of EventService<TAuthenticationToken>.
Declaration
protected EventService(IEventStore<TAuthenticationToken> eventStore, ILogger logger, ICorrelationIdHelper correlationIdHelper, IAuthenticationTokenHelper<TAuthenticationToken> authenticationTokenHelper)
Parameters
Type | Name | Description |
---|---|---|
IEventStore<TAuthenticationToken> | eventStore | |
cdmdotnet.Logging.ILogger | logger | |
cdmdotnet.Logging.ICorrelationIdHelper | correlationIdHelper | |
IAuthenticationTokenHelper<TAuthenticationToken> | authenticationTokenHelper |
Properties
AuthenticationTokenHelper
Gets or sets the IAuthenticationTokenHelper<TAuthenticationToken>.
Declaration
protected IAuthenticationTokenHelper<TAuthenticationToken> AuthenticationTokenHelper { get; }
Property Value
Type | Description |
---|---|
IAuthenticationTokenHelper<TAuthenticationToken> |
CorrelationIdHelper
Gets or sets the cdmdotnet.Logging.ILogger.
Declaration
protected ICorrelationIdHelper CorrelationIdHelper { get; }
Property Value
Type | Description |
---|---|
cdmdotnet.Logging.ICorrelationIdHelper |
EventStore
Gets or sets the IEventStore<TAuthenticationToken>.
Declaration
protected virtual IEventStore<TAuthenticationToken> EventStore { get; }
Property Value
Type | Description |
---|---|
IEventStore<TAuthenticationToken> |
Logger
Gets or sets the cdmdotnet.Logging.ILogger.
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
cdmdotnet.Logging.ILogger |
Methods
CompleteResponse<TServiceResponse>(TServiceResponse)
Sets the CorrelationId on the provided serviceResponse
.
Declaration
protected virtual TServiceResponse CompleteResponse<TServiceResponse>(TServiceResponse serviceResponse)where TServiceResponse : IServiceResponse
Parameters
Type | Name | Description |
---|---|---|
TServiceResponse | serviceResponse |
Returns
Type | Description |
---|---|
TServiceResponse |
Type Parameters
Name | Description |
---|---|
TServiceResponse |
GetEventData(IServiceRequestWithData<TAuthenticationToken, Guid>)
Get all IEvent<TAuthenticationToken> raised with the same CorrelationId.
Declaration
public virtual IServiceResponseWithResultData<IEnumerable<EventData>> GetEventData(IServiceRequestWithData<TAuthenticationToken, Guid> serviceRequest)
Parameters
Type | Name | Description |
---|---|---|
IServiceRequestWithData<TAuthenticationToken, System.Guid> | serviceRequest | The CorrelationId of the IEvent<TAuthenticationToken> to find. |
Returns
Type | Description |
---|---|
IServiceResponseWithResultData<System.Collections.Generic.IEnumerable<EventData>> |
Implements
OnGetEventData(IServiceRequestWithData<TAuthenticationToken, Guid>)
Executed before calling the Get(Type, Guid, Boolean, Int32) method on EventStore in GetEventData(IServiceRequestWithData<TAuthenticationToken, Guid>).
Declaration
protected virtual void OnGetEventData(IServiceRequestWithData<TAuthenticationToken, Guid> serviceRequest)
Parameters
Type | Name | Description |
---|---|---|
IServiceRequestWithData<TAuthenticationToken, System.Guid> | serviceRequest | The original IServiceRequestWithData<TAuthenticationToken, TData>. |
OnGotEventData(IServiceRequestWithData<TAuthenticationToken, Guid>, IEnumerable<EventData>)
Executed after calling the Get(Type, Guid, Boolean, Int32) method on EventStore in GetEventData(IServiceRequestWithData<TAuthenticationToken, Guid>).
Declaration
protected virtual IEnumerable<EventData> OnGotEventData(IServiceRequestWithData<TAuthenticationToken, Guid> serviceRequest, IEnumerable<EventData> results)
Parameters
Type | Name | Description |
---|---|---|
IServiceRequestWithData<TAuthenticationToken, System.Guid> | serviceRequest | The original IServiceRequestWithData<TAuthenticationToken, TData>. |
System.Collections.Generic.IEnumerable<EventData> | results | The collection of IEvent<TAuthenticationToken> from the EventStore. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<EventData> |