Exemplo n.º 1
0
        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)));
        }
Exemplo n.º 2
0
        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)));
        }
Exemplo n.º 3
0
 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)));
 }
Exemplo n.º 4
0
 public static IServiceCollection StaticTenant(this ITenantIdentification identification, string tenant)
 {
     return(identification.Services.AddScoped <ITenantIdentificationService>(sp => new StaticTenantIdentificationService(tenant)));
 }
Exemplo n.º 5
0
 public static IServiceCollection TenantForSourceIP(this ITenantIdentification identification)
 {
     return(identification.Services.AddScoped <ITenantIdentificationService, SourceIPTenantIdentificationService>());
 }
Exemplo n.º 6
0
 public static IServiceCollection TenantForQueryString(this ITenantIdentification identification)
 {
     return(identification.Services.AddScoped <ITenantIdentificationService, QueryStringTenantIdentificationService>());
 }
Exemplo n.º 7
0
 public static IServiceCollection TenantForHost(this ITenantIdentification identification)
 {
     return(identification.Services.AddScoped <ITenantIdentificationService, HostTenantIdentificationService>());
 }