AdapterTenantScope
Namespace: Meshmakers.Octo.Sdk.Common.Services
The dedicated-adapter implementation of IAdapterTenantScope (AB#4924, increment 3).
public sealed class AdapterTenantScope : IAdapterTenantScope
Inheritance Object → AdapterTenantScope
Implements IAdapterTenantScope
Remarks:
Registered as a singleton that carries an AsyncLocal<T> value, not
as a scoped service. The distinction matters: pipeline executions run concurrently on the
same process and a DI scope does not follow an async call chain, whereas the tenant of an
execution must. An AsyncLocal flows into every continuation of the execution that
set it and into nothing else, which is exactly the shape of "the tenant of this work
item".
🔴 AdapterTenantScope.IsPoolMember is hard-coded false and is deliberately not bound to
configuration. Increment 3 ships as a behaviour-preserving refactor that the whole fleet
bakes for one release before any lease exists; a flag that could flip it by environment
variable would defeat the point of baking it.
Properties​
IsPoolMember​
public bool IsPoolMember { get; }
Property Value​
HasTenant​
public bool HasTenant { get; }
Property Value​
TenantId​
public string TenantId { get; }
Property Value​
Constructors​
AdapterTenantScope()​
public AdapterTenantScope()
Methods​
BeginExecution(String)​
public IDisposable BeginExecution(string tenantId)
Parameters​
tenantId String