public PeopleAreUsHttpClient(HttpClient client, PeopleAreUsApiConfig config, IPeopleDataConverter converter, ILogger <PeopleAreUsHttpClient> logger) { _client = client; _config = config; _converter = converter; _logger = logger; }
public static void UseInfrastructure(this IServiceCollection services, PeopleAreUsApiConfig config) { if (services == null || config == null) { throw new Exception("Insufficient configuration data"); } services.AddSingleton(config); services.AddHttpClient <IPeopleAreUsHttpClient, PeopleAreUsHttpClient>(); services.AddSingleton <IPeopleDataConverter, JsonPeopleDataConverter>(); }