We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f75ba2c commit 3263effCopy full SHA for 3263eff
src/Finbuckle.MultiTenant.AspNetCore/Extensions/MultiTenantBuilderExtensions.cs
@@ -220,10 +220,8 @@ public static MultiTenantBuilder<TTenantInfo> WithBasePathStrategy<TTenantInfo>(
220
var origOnTenantResolved = options.Events.OnTenantResolved;
221
options.Events.OnTenantResolved = tenantResolvedContext =>
222
{
223
- var httpContext = tenantResolvedContext.Context as HttpContext ??
224
- throw new MultiTenantException("BasePathStrategy expects HttpContext.");
225
-
226
if (tenantResolvedContext.StrategyType == typeof(BasePathStrategy) &&
+ tenantResolvedContext.Context is HttpContext httpContext &&
227
httpContext.RequestServices.GetRequiredService<IOptions<BasePathStrategyOptions>>().Value
228
.RebaseAspNetCorePathBase)
229
0 commit comments