public static IServiceCollection TenantForSourceIP <TTenant>(this TenantRequestIdentification <TTenant> identification) where TTenant : AppTenant { return(identification._services.AddScoped <ITenantIdentificationService <TTenant>, SourceIPIdentificationService <TTenant> >()); }
public static IServiceCollection DynamicTenant <TTenant>(this TenantRequestIdentification <TTenant> identification, Func <HttpContext, TTenant> currentTenant, Func <IEnumerable <TTenant> > allTenants) where TTenant : AppTenant { return(identification._services.AddScoped <ITenantIdentificationService <TTenant> >(sp => new DynamicTenantIdentificationService <TTenant>(sp.GetRequiredService <IHttpContextAccessor>(), sp.GetRequiredService <ILogger <ITenantIdentificationService <TTenant> > >(), currentTenant, allTenants))); }