Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created March 19, 2016 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/4b6e7851d0994811382d to your computer and use it in GitHub Desktop.
Save dcomartin/4b6e7851d0994811382d to your computer and use it in GitHub Desktop.
public class Envelope<T> : IAsyncRequest, IAsyncNotification
{
public Envelope(Guid messageId, Guid correlationId, T message)
{
MessageId = messageId;
CorrelationId = correlationId;
Body = message;
}
public Envelope(T message) : this(Guid.NewGuid(), Guid.NewGuid(), message) { }
public Envelope(Guid correlationId, T message) : this(Guid.NewGuid(), correlationId, message) { }
public T Body { get; }
public Guid MessageId { get; }
public Guid CorrelationId { get; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment