diff --git a/src/Infrastructure/Middleware/MultiTenantRequestServicesMiddleware.cs b/src/Infrastructure/Middleware/MultiTenantRequestServicesMiddleware.cs index 3809cf3..68283a8 100644 --- a/src/Infrastructure/Middleware/MultiTenantRequestServicesMiddleware.cs +++ b/src/Infrastructure/Middleware/MultiTenantRequestServicesMiddleware.cs @@ -27,10 +27,9 @@ public async Task Invoke(HttpContext context) httpContextAccessor.HttpContext ??= context; //Replace the service providers feature with our tenant specific one - IServiceProvidersFeature existingFeature = null!; + IServiceProvidersFeature? existingFeature = context.Features.Get(); try { - existingFeature = context.Features.Get()!; context.Features.Set(new RequestServicesFeature(context, multiTenantServiceProviderScopeFactory)); await next.Invoke(context); }