コード例 #1
0
        public async Task Handle(RemoveSuperpowerCommand notification, CancellationToken cancellationToken)
        {
            if (!notification.IsValid())
            {
                NotifyValidationErrors(notification);
                return;
            }

            _superpowerRepository.Remove(notification.Id);

            if (await CommitAsync())
            {
                var superpowerEvent = new SuperpowerRemovedEvent(notification.Id);
                await _bus.RaiseEvent(superpowerEvent);
            }
        }
コード例 #2
0
 public async Task Handle(SuperpowerRemovedEvent notification, CancellationToken cancellationToken)
 {
     await _cacheManager.RemoveAsync($"superpowerGetAsync_{notification.Id}");
 }