13 lines
389 B
C#
13 lines
389 B
C#
using Microsoft.AspNetCore.Http;
|
|
|
|
namespace AMREZ.EOP.Domain.Shared.Tenancy;
|
|
|
|
public static class HttpContextTenantExtensions
|
|
{
|
|
public static string? GetTargetTenantKey(this HttpContext http)
|
|
{
|
|
return http.Items.TryGetValue("TargetTenantKey", out var v)
|
|
? v as string
|
|
: http.Request.Headers["X-Tenant"].ToString()?.Trim().ToLowerInvariant();
|
|
}
|
|
} |