QueryStringTenantResolver class
Namespace: Tenantry.AspNetCore.Resolution · Package: Tenantry.AspNetCore · API reference
Resolves the tenant from a query string parameter (e.g. ?tenantId=acme).
Intended for local development and testing convenience only. Do not enable in production — query string parameters are logged and may appear in analytics, CDN caches, and browser history.
public sealed class QueryStringTenantResolver : ITenantResolverImplements ITenantResolver.
Constructors
QueryStringTenantResolver(string)
Resolves the tenant from a query string parameter (e.g. ?tenantId=acme).
public QueryStringTenantResolver(string parameterName = "tenantId")Parameters:
parameterNamestring: The name of the query string parameter that carries the tenant identifier.
Intended for local development and testing convenience only. Do not enable in production — query string parameters are logged and may appear in analytics, CDN caches, and browser history.
Methods
ResolveAsync(HttpContext, CancellationToken)
Attempts to extract a tenant ID from the current request.
public ValueTask<string?> ResolveAsync(HttpContext context, CancellationToken cancellationToken = default)Parameters:
contextHttpContext: The current HTTP context.cancellationTokenCancellationToken: Cancellation token.
Returns: ValueTask<string>: The resolved tenant ID string, or null if this resolver cannot determine the tenant from the current request.