예제 #1
0
        public List <LogicalMessage> CreateMultiple(IEnumerable <object> messages)
        {
            if (messages == null)
            {
                return(new List <LogicalMessage>());
            }

            return(messages.Select(m =>
            {
                var messageType = MessageMapper.GetMappedTypeFor(m.GetType());
                var headers = GetMessageHeaders(m);

                return new LogicalMessage(MessageMetadataRegistry.GetMessageDefinition(messageType), m, headers, this);
            }).ToList());
        }
예제 #2
0
        public LogicalMessage Create(Type messageType, object message, Dictionary <string, string> headers)
        {
            var realMessageType = MessageMapper.GetMappedTypeFor(messageType);

            return(new LogicalMessage(MessageMetadataRegistry.GetMessageDefinition(realMessageType), message, headers, this));
        }