zeroframework/Services/Identity/ZeroFramework.IdentityServer.API/Tenants/CurrentTenantAccessor.cs

11 lines
399 B
C#
Raw Permalink Normal View History

2023-12-05 09:22:48 +00:00
namespace ZeroFramework.IdentityServer.API.Tenants
{
public class CurrentTenantAccessor : ICurrentTenantAccessor
{
private readonly AsyncLocal<TenantInfo?> _currentScope = new();
public TenantInfo? Current { get => _currentScope.Value; set => _currentScope.Value = value; }
public CurrentTenantAccessor() => _currentScope = new AsyncLocal<TenantInfo?>();
}
}