Exemplo n.º 1
0
 /// <summary>
 /// Constructs a Message for the given <code>payload</code> and <code>meta data</code>. The given <code>metaData</code> is
 /// merged with the MetaData from the correlation data of the current unit of work, if present.
 /// </summary>
 /// <param name="declaredPayloadType">The declared type of message payload</param>
 /// <param name="payload">The payload for the message</param>
 /// <param name="metaData">The meta data for the message</param>
 public GenericMessage(Type declaredPayloadType,
                       T?payload,
                       IImmutableDictionary <string, object> metaData) : this(
         IdentifierFactory.GetInstance().GenerateIdentifier(),
         declaredPayloadType,
         payload,
         CurrentUnitOfWork <IMessage <T>, T> .CorrelationData().MergedWith(MetaData.From(metaData))
         )
 {
 }