コード例 #1
0
        /// <summary>
        ///     Invokes the message chain with a message wrapped in potential actions.
        /// </summary>
        /// <param name="message">A dynamic message created by <see cref="ICoreService.CreateMessage" /> method.</param>
        /// <returns></returns>
        private Task[] PostMessageToServices(dynamic message)
        {
            // Invoke the message chain.
            MessageChain?.Invoke(message);

            var tasks = new List <Task>();

            foreach (var serv in Services)
            {
                tasks.Add(serv.HandleMessage(message));
            }

            return(tasks.ToArray());
        }