Last active
January 25, 2017 06:23
-
-
Save pardahlman/db0d7bb93d2540aa4a07bf7771929191 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static Task SubscribeAsync<TMessage, TMessageContext>(Func<TMessage, TMessageContext, Task> asyncHandler) | |
{ | |
return BusClient.SubscribeAsync<TMessage, TMessageContext>(async (message, context) => | |
{ | |
var customCtx = context as CustomContext; | |
using (LogContext.PushProperty("executionId", customCtx?.ExecutionId)) | |
using (LogContext.PushProperty("origin", customCtx?.Origin)) | |
using (LogContext.PushProperty("sessionId", customCtx?.SessionId)) | |
{ | |
await asyncHandler(message, context); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment