Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for different dependency lifetime #14

Closed
msmolka opened this issue Apr 25, 2023 · 2 comments · Fixed by #17
Closed

Add support for different dependency lifetime #14

msmolka opened this issue Apr 25, 2023 · 2 comments · Fixed by #17

Comments

@msmolka
Copy link

msmolka commented Apr 25, 2023

I would like to have singleton for authentication client as in most cases never changed during application lifetime.

@Hawxy
Copy link
Owner

Hawxy commented Apr 26, 2023

This isn't considered good practice as we're using the IHttpClientFactory pattern. The client is designed to be short-lived as the internal handler is pooled. See https://learn.microsoft.com/en-us/dotnet/core/extensions/httpclient-factory#httpclient-lifetime-management

@msmolka
Copy link
Author

msmolka commented Apr 26, 2023

Ok, closing then

@msmolka msmolka closed this as completed Apr 26, 2023
@Hawxy Hawxy mentioned this issue Jun 19, 2023
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants