Is it ok to have a static BaseClientService inherited service instance in a .NET 4.8 ASP.NET app? #2902
Labels
needs more info
This issue needs more information from the customer to proceed.
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: question
Request for information or clarification. Not an issue.
We integrated the
AndroidPublisherService
in a server-side ASP.NET 4.8 app.Our concern is the service instance lifetime. Since the class seems to create and dispose the
HttpClient
internally (which, as we all know is not recommended in the long run and instead theHttpClient
should be shared) it would seem that making the instance static should be recommended.Is that so? Any specific details to consider?
I know that in case of .NET Core, a built-in HttpClient instance manager can possibly be integrated with the publisher service instance. But the question is specific to .NET 4.8.
In technical terms, is it ok to have
and then anytime we need the port:
Note that the
AndroidPublisherService
is static in the port class but the port class is then used in use case handlers as transient.What I need is a clear confirmation that this is correct approach. Thanks in advance.
The text was updated successfully, but these errors were encountered: