public static IServiceCollection TenantForSourceIP(this ITenantIdentification identification, Action <SourceIPTenantIdentificationOption> optionsBuilder) { var options = new SourceIPTenantIdentificationOption(); optionsBuilder?.Invoke(options); return(identification.Services.AddScoped <ITenantIdentificationService, SourceIPTenantIdentificationService>(sp => new SourceIPTenantIdentificationService(options))); }
public static IServiceCollection TenantForQueryString(this ITenantIdentification identification, Action <QueryStringTenantIdentificationOption> optionsBuilder) { var options = new QueryStringTenantIdentificationOption(); optionsBuilder?.Invoke(options); return(identification.Services.AddScoped <ITenantIdentificationService, QueryStringTenantIdentificationService>(sp => new QueryStringTenantIdentificationService(options))); }
public static IServiceCollection DynamicTenant(this ITenantIdentification identification, Func <HttpContext, string> currentTenant, IEnumerable <string> allTenants = null) { return(identification.Services.AddScoped <ITenantIdentificationService>(sp => new DynamicTenantIdentificationService(currentTenant, allTenants))); }
public static IServiceCollection StaticTenant(this ITenantIdentification identification, string tenant) { return(identification.Services.AddScoped <ITenantIdentificationService>(sp => new StaticTenantIdentificationService(tenant))); }
public static IServiceCollection TenantForSourceIP(this ITenantIdentification identification) { return(identification.Services.AddScoped <ITenantIdentificationService, SourceIPTenantIdentificationService>()); }
public static IServiceCollection TenantForQueryString(this ITenantIdentification identification) { return(identification.Services.AddScoped <ITenantIdentificationService, QueryStringTenantIdentificationService>()); }
public static IServiceCollection TenantForHost(this ITenantIdentification identification) { return(identification.Services.AddScoped <ITenantIdentificationService, HostTenantIdentificationService>()); }