From b1929849f2838bd8814e368032d56b69f8ddce99 Mon Sep 17 00:00:00 2001 From: Kasper Christiansen Date: Sat, 13 Jul 2024 14:02:10 +0200 Subject: [PATCH] Updated doc --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3cf6399..f3a7c7d 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,18 @@ After registering the services you can inject the client and configuration. ```csharp public class MyService { - private readonly ITjekClient _tjekClient; + private readonly IHttpClientFactory _httpClientFactory; private readonly TjekClientConfig _tjekClientConfig; - public MyService(ITjekClient tjekClient, IOptions tjekClientConfig) + public MyService(IHttpClientFactory httpClientFactory, IOptions tjekClientConfig) { - _tjekClient = tjekClient; + _httpClientFactory = httpClientFactory; _tjekClientConfig = tjekClientConfig.Value; } + + public Task MyMethod() + { + var client = _httpClientFactory.CreateClient(Constants.HttpClientName); + } } ```