flagsmith-dotnet-client
flagsmith-dotnet-client copied to clipboard
Question: DI registration example
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
@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.