示例#1
0
        public void Handle(IEventSourcingEvent e)
        {
            switch (e.DomainEvent)
            {
            case Opened opened: Handle(opened);
                break;

            case GuessMade guessMade:
                Handle(guessMade);
                break;

            case LevelSucceeded succeeded:
                Handle(succeeded);
                break;

            case LevelFailed failed:
                Handle(failed);
                break;

            case GameCompleted completed:
                Handle(completed);
                break;
            }
        }
示例#2
0
        public void Handle(IEventSourcingEvent e)
        {
            string aggregateId = e.AggregateId;

            Handle(aggregateId, e);
        }
示例#3
0
        private void Handle(string aggregateId, IEventSourcingEvent @event)
        {
            string serializedEvent = JsonSerializer.Serialize(@event, typeof(IEventSourcingEvent));

            _hub.Clients.Group(aggregateId).SendAsync("ReceiveEvent", serializedEvent);
        }
示例#4
0
 public void Emit(IEventSourcingEvent e)
 {
     On?.Invoke(this, e);
 }