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

Question: DI registration example #80

Open
vpetrusevici opened this issue Oct 26, 2023 · 1 comment
Open

Question: DI registration example #80

vpetrusevici opened this issue Oct 26, 2023 · 1 comment

Comments

@vpetrusevici
Copy link
Contributor

vpetrusevici commented Oct 26, 2023

Hi guys!
I see in the example you register Flagsmith client as singleton, but in fact this is a typed httpclient.
Is it better to use this approach mb?

services.Configure<FlagsmithConfiguration>(builder.Configuration.GetSection(nameof(FlagsmithConfiguration)));
services.AddHttpClient<IFlagsmithClient, FlagsmithClient>(nameof(FlagsmithClient));

Because static/singleton HttpClient doesn't respect DNS changes and is considered bad practice. See details here

@novakzaballa
Copy link
Contributor

@vpetrusevici thank you for bringing this to our attention. We will consider your comments. If you like to build a PR with the proposed changes it would be also much appreciated.

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

No branches or pull requests

2 participants