Example #1
0
        public MessageProcessorV2(IMessageResolver resolver)
        {
            _parsableMessages  = new Dictionary <ushort, Type>();
            _messageAttributes = new Dictionary <Type, MessageAttribute>();
            _validators        = new Dictionary <Type, MessageValidator>();
            _nestedValidators  = new Dictionary <Type, MessageValidator>();

            var resolvedMessages = resolver.Resolve();

            AddMessages(resolvedMessages);

            Console.WriteLine("Parsable Messages Cached: {0}", _parsableMessages.Count);
            Console.WriteLine("Attributes Cached: {0}", _messageAttributes.Count);
        }
        public Postmessage CreatePostmessage()
        {
            Postmessage postmessage = new Postmessage
            {
                CreationDate = DateTime.Now,
                Status       = PostmessageStatus.Creation,
                Message      = _messageResolver.Resolve(),
                SentDate     = (DateTime)SqlDateTime.MinValue,
                ReceivedDate = (DateTime)SqlDateTime.MinValue
            };

            _postmessageRepository.Create(postmessage);

            return(postmessage);
        }