Table of Contents

Method BeginScope

Namespace
Millrace.Tenancy
Assembly
Millrace.dll

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

tenantId string

Returns

IDisposable

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.