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