private Task PublishNotificationToCreatedTopic(CreateTopicResponse topicResponse, EmailNotificationDto emailNotification) { return(SubscribeToTopic(topicResponse, AwsNotificationProtocolName, emailNotification.Emails) .ContinueWith(response => PublishMessageToTopic(emailNotification.Content, topicResponse.TopicArn)) .ContinueWith(response => DeleteTopic(topicResponse.TopicArn))); }
public async Task NotifyAsync(EmailNotificationDto emailNotification) { await CreateSnsTopic(_topicNames[emailNotification.NotificationType]) .ContinueWith(topicResponse => PublishNotificationToCreatedTopic(topicResponse.Result, emailNotification)); }