Hi, guys.
I want to know which endpoint requested a job (especially in logging).
For that purpose, I want to utilize the CorrelationId
string taken from HttpContext.TraceIdentifier
. The obvious solution is to manually pass the string via method arguments, but I would like to have it in an elegant way. Then, I would like to pass the string via DI injection when a command is created.
Is there a way to automatically retrieve IHttpContextAccessor
and use its HttpContext
to populate CorrelationId
when the job is enqueued?