Skip to content

Instantly share code, notes, and snippets.

@TechWatching
Last active May 19, 2021 16:49
Show Gist options
  • Save TechWatching/a907d4bcc06fa98a60f2939a6a388ec6 to your computer and use it in GitHub Desktop.
Save TechWatching/a907d4bcc06fa98a60f2939a6a388ec6 to your computer and use it in GitHub Desktop.

Revisions

  1. TechWatching revised this gist Jan 29, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion StartupWithAuthenticationHandler.cs
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ public void ConfigureServices(IServiceCollectionservices)
    services.AddHttpClient<IUserApiAuthenticationService, UserApiAuthenticationService>()
    .ConfigureHttpClient(c => c.BaseAddress ="http://urltotheuserapi.com");

    services.AddTransient<UserApiAuthenticationHandler();
    services.AddTransient<UserApiAuthenticationHandler>();
    services.AddHttpClient<UserService, UserService>()
    .ConfigureHttpClient(c => c.BaseAddress ="http://urltotheuserapi.com")
    .AddHttpMessageHandler<UserApiAuthenticationHanler>();
  2. TechWatching revised this gist Jan 28, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions StartupWithAuthenticationHandler.cs
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    public void ConfigureServices(IServiceCollectionservices)
    {
    services.AddMemoryCache();
    servicesAddHttpClient<IUserApiAuthenticationService,UserApiAuthenticationService>()
    .ConfigureHttpClient(c => c.BaseAddress ="http://urltotheuserapi.com");
    services.AddHttpClient<IUserApiAuthenticationService, UserApiAuthenticationService>()
    .ConfigureHttpClient(c => c.BaseAddress ="http://urltotheuserapi.com");

    services.AddTransient<UserApiAuthenticationHandler();
    services.AddHttpClient<UserService, UserService>()
    .ConfigureHttpClient(c => c.BaseAddress ="http://urltotheuserapi.com")
    AddHttpMessageHandler<UserApiAuthenticationHanler>();
    .ConfigureHttpClient(c => c.BaseAddress ="http://urltotheuserapi.com")
    .AddHttpMessageHandler<UserApiAuthenticationHanler>();
    }
  3. TechWatching created this gist Jan 28, 2020.
    11 changes: 11 additions & 0 deletions StartupWithAuthenticationHandler.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    public void ConfigureServices(IServiceCollectionservices)
    {
    services.AddMemoryCache();
    servicesAddHttpClient<IUserApiAuthenticationService,UserApiAuthenticationService>()
    .ConfigureHttpClient(c => c.BaseAddress ="http://urltotheuserapi.com");

    services.AddTransient<UserApiAuthenticationHandler();
    services.AddHttpClient<UserService, UserService>()
    .ConfigureHttpClient(c => c.BaseAddress ="http://urltotheuserapi.com")
    AddHttpMessageHandler<UserApiAuthenticationHanler>();
    }