Add DefaultTenantAccessor and ITenantAccessor interface

Introduce ITenantAccessor interface and its implementation, DefaultTenantAccessor, for tenant management in the multitenancy module. This setup will allow future enhancements for tenant-specific functionality.
This commit is contained in:
Sipke Schoorstra 2024-10-06 14:49:02 +02:00
parent dd812645c7
commit e1d0cc2e27
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,10 @@
namespace Elsa.Common.Multitenancy;
public interface ITenantAccessor
{
/// <summary>
/// Get the current <see cref="Tenant"/>.
/// </summary>
/// <returns>Current tenant or null.</returns>
Tenant? GetTenant();
}

View file

@ -0,0 +1,13 @@
namespace Elsa.Common.Multitenancy;
public class DefaultTenantAccessor : ITenantAccessor
{
public Tenant? GetTenant()
{
// Similar to how the HttpContextAccessor is implemented:
return null;
}
}