public async Task NotifyAsync(IMediatorComponent sender, IMediationEvent @event)
        {
            InitializeComponents();

            // each of these event handling stuff is usually moved to their own event handlers
            // in libraries like https://github.com/jbogard/MediatR/wiki
            if (@event is UserDeletionEvent userDeletionEvent)
            {
                await _orderService.DeleteOrdersAsync(userDeletionEvent.UserId);
            }
            else if (@event is OrderCompletionEvent orderCompletionEvent)
            {
                await _userService.IncreaseReputationAsync(orderCompletionEvent.UserId);
            }
        }
Esempio n. 2
0
 public PrimaryMessageActor(IMediatorComponent mediator)
     : base(mediator)
 {
 }
Esempio n. 3
0
 public SecondaryMessageActor(IMediatorComponent mediator)
     : base(mediator)
 {
 }
Esempio n. 4
0
 protected MessageActor(IMediatorComponent mediator)
 {
     m_mediatorComponent = mediator;
     m_mediatorComponent.MessageActivatedEvent += MessageRecevie;
 }