Exemple #1
0
        /// <summary>
        /// Asynchronously sends a notification to the queue.
        /// </summary>
        /// <param name="account">The account to send the notification to.</param>
        /// <param name="notification">A notification to send.</param>
        /// <returns>The task.</returns>
        public Task SendAsync <TAccountKey>(NotificationAccount <TAccountKey> account, Notification notification)
        {
            Throw.IfArgumentNull(account, nameof(account));
            Throw.IfArgumentNull(notification, nameof(notification));

            INotificationChannel channel = this.channelFactory.GetChannel(notification);

            return(channel.SendAsync(account, notification));
        }
        public async Task <bool> Send([FromQuery] string message)
        {
            var messages = new[] { "a", "b", "c", "d", "e" };

            foreach (var msg in messages)
            {
                await _notificationChannel.SendAsync(msg);
            }

            return(true);
        }