Beispiel #1
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)));
        }
Beispiel #2
0
        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;
        }
Beispiel #3
0
 public QueryStringTenantIdentificationService(QueryStringTenantIdentificationOption options)
 {
     this._options = options;
 }