示例#1
0
 public static IServiceCollection TenantForSourceIP <TTenant>(this TenantRequestIdentification <TTenant> identification)
     where TTenant : AppTenant
 {
     return(identification._services.AddScoped <ITenantIdentificationService <TTenant>, SourceIPIdentificationService <TTenant> >());
 }
示例#2
0
 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)));
 }