public IBusinessMessage GetMessage(IEdifactMessage edifactMessage)
 {
     return(new Cancellation
     {
         Id = Guid.NewGuid(),
         Timestamp = edifactMessage.TimestampUtc
     });
 }
 public IBusinessMessage GetMessage(IEdifactMessage edifactMessage)
 {
     return(new Invoice
     {
         Id = Guid.NewGuid(),
         Timestamp = edifactMessage.TimestampUtc
     });
 }
 public IBusinessMessage GetMessage(IEdifactMessage edifactMessage)
 {
     return(new Measurement
     {
         Id = Guid.NewGuid(),
         Timestamp = edifactMessage.TimestampUtc
     });
 }
        public IBusinessMessage GetMessage(IEdifactMessage edimsg)
        {
            var matchingFactory = _factories.FirstOrDefault(x => x.Predicate(edimsg));

            if (matchingFactory != null)
            {
                return(matchingFactory.GetMessage(edimsg));
            }
            throw new NotSupportedException($"There no matching factory for {edimsg.MessageId} - {edimsg.Version}");
        }