public async Task Handle(ApplicationCreatedEvent applicationCreatedEvent) { var categoryUsedEvent = new CategoryUsedEvent(applicationCreatedEvent.Category, $"{APPLICATION_NAME}_{applicationCreatedEvent.Id}", applicationCreatedEvent.Id); await _eventPublisher.PublishEvent(categoryUsedEvent); await _pushNotificationSender.SendNotification(applicationCreatedEvent, "New candidate has registered!"); }
public async Task Run( [ActivityTrigger] IDurableActivityContext context) { var command = context.GetInput <SaveApplicationCommand>(); var categoryUsedEvent = new CategoryUsedEvent(command.Category, $"{nameof(DataStorage.Models.Application)}_{command.Id}"); await _eventPublisher.PublishEvent(categoryUsedEvent); var applicationAddedEvent = _mapper.Map <SaveApplicationCommand, ApplicationChangedEvent>(command); await _eventPublisher.PublishEvent(applicationAddedEvent); await _pushNotificationSender.SendNotification(applicationAddedEvent, "New candidate has registered!"); }