示例#1
0
        public static IServiceCollection TenantForHeader(this ITenantIdentification identification, Action <HeaderTenantIdentificationOption> optionsBuilder)
        {
            var options = new HeaderTenantIdentificationOption();

            optionsBuilder?.Invoke(options);
            return(identification.Services.AddScoped <ITenantIdentificationService, HeaderTenantIdentificationService>(sp => new HeaderTenantIdentificationService(options)));
        }
 public HeaderTenantIdentificationService(HeaderTenantIdentificationOption options)
 {
     this._options = options;
 }
 public HeaderTenantIdentificationService(IConfiguration configuration, string header = nameof(TenantService.Tenant))
 {
     this._options         = new HeaderTenantIdentificationOption();
     this._options.Mapping = configuration.GetTenantMapping();
     this._options.Header  = header ?? this._options.Header;
 }