Skip to content

Commit 0fb69e6

Browse files
authored
Merge pull request #32717 from brettsam/patch-1
Change DI sample to use IHttpClientFactory
2 parents cd5e4a2 + 612bb59 commit 0fb69e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/azure-functions/functions-dotnet-dependency-injection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ namespace MyNamespace
6464
private readonly IMyService _service;
6565
private readonly HttpClient _client;
6666

67-
public HttpTrigger(IMyService service, HttpClient client)
67+
public HttpTrigger(IMyService service, IHttpClientFactory httpClientFactory)
6868
{
6969
_service = service;
70-
_client = client;
70+
_client = httpClientFactory.CreateClient();;
7171
}
7272

7373
[FunctionName("GetPosts")]

0 commit comments

Comments
 (0)