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))); }
public SourceIPTenantIdentificationService(SourceIPTenantIdentificationOption options) { this._options = options; }
public SourceIPTenantIdentificationService(IConfiguration configuration) { this._options = new SourceIPTenantIdentificationOption(); this._options.Mapping = configuration.GetTenantMapping(); }