Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MessageHandler
public abstract class MessageHandler : IMessageHandler
{
private IMessageHandler nextHandler;
public void SetNextHandler(IMessageHandler nextHandler)
{
this.nextHandler = nextHandler;
}
public virtual async Task<Message> HandleMessage(Message sourceMessage)
{
return nextHandler != null ? await (nextHandler?.HandleMessage(sourceMessage)) : sourceMessage;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.