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 QueryStringTenantIdentificationService(IConfiguration configuration, string tenantKey = nameof(TenantService.Tenant)) { var options = new QueryStringTenantIdentificationOption(); options.Mapping = configuration.GetTenantMapping(); options.Parameter = tenantKey ?? options.Parameter; this._options = options; }
public QueryStringTenantIdentificationService(QueryStringTenantIdentificationOption options) { this._options = options; }