Ejemplo n.º 1
0
        public IMessenger Add(Message message)
        {
            var providerMessages = messageProvider.Get() as Queue<Message>
                ?? new Queue<Message>();

            message.MessengerOrderId = providerMessages.Count();

            var messages = SetMessageOrder(providerMessages);

            messages.Enqueue(message);
            messageProvider.Set(messages);

            return this;
        }
Ejemplo n.º 2
0
        public IMessenger Add(Message message)
        {
            var providerMessages = messageProvider.Get() as Stack<Message>
                ?? new Stack<Message>();

            message.MessengerOrderId = providerMessages.Count();

            var messages = SetMessageOrder(providerMessages);

            messages.Push(message);
            messageProvider.Set(messages);

            return this;
        }