Exemplo n.º 1
0
 private IServiceCollection GetServices()
 {
     services.AddHttpClient("taxJar", c =>
     {
         c.BaseAddress = new Uri("https://api.taxjar.com/v2/");
         c.DefaultRequestHeaders.Add("Authorization", "Bearer 5da2f821eee4035db4771edab942a4cc");
     });
     services.AddScoped <ILogging, Logging>();
     services.AddScoped <ITaxHttpClient, TaxHttpClient>();
     _taxhttpClient = services.BuildServiceProvider().GetService <ITaxHttpClient>();
     return(services);
 }
Exemplo n.º 2
0
 public TaxCalculator(ITaxHttpClient taxHttpClient)
 {
     _taxHttpClient = taxHttpClient;
 }