Method BeginScope
BeginScope(string?)
Makes tenantId ambient until the returned scope is disposed.
Workers call this before resolving a job's target so execution observes the tenant the
job was enqueued under.
public IDisposable BeginScope(string? tenantId)
Parameters
tenantIdstring
Returns
Remarks
Scopes nest: disposing restores the value that was ambient before, rather than clearing it, so a worker that begins a scope inside an existing one leaves the outer tenant intact.