Пример #1
0
        /// <summary>
        /// Gets the outgoing messages for the incoming message with the given ID
        /// </summary>
        public IEnumerable <OutgoingMessage> GetOutgoingMessages(string messageId)
        {
            var outgoingMessages = OutgoingMessages.FirstOrDefault(o => o.MessageId == messageId);

            return(outgoingMessages != null
                ? outgoingMessages.MessagesToSend
                : Enumerable.Empty <OutgoingMessage>());
        }
Пример #2
0
        OutgoingMessages GetOrCreate(string messageId)
        {
            HandledMessageIds.Add(messageId);

            var outgoingMessages = OutgoingMessages.FirstOrDefault(o => o.MessageId == messageId);

            if (outgoingMessages != null)
            {
                return(outgoingMessages);
            }

            outgoingMessages = new OutgoingMessages(messageId, new List <OutgoingMessage>());
            OutgoingMessages.Add(outgoingMessages);

            return(outgoingMessages);
        }