public static IServiceCollection TenantForHost(this ITenantIdentification identification, Action <HostTenantIdentificationOption> optionsBuilder) { var options = new HostTenantIdentificationOption(); optionsBuilder?.Invoke(options); return(identification.Services.AddScoped <ITenantIdentificationService, HostTenantIdentificationService>(sp => new HostTenantIdentificationService(options))); }
public HostTenantIdentificationService(HostTenantIdentificationOption options) { this._options = options; }
public HostTenantIdentificationService(IConfiguration configuration) { this._options = new HostTenantIdentificationOption(); this._options.Mapping = configuration.GetTenantMapping(); }