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