-
-
Notifications
You must be signed in to change notification settings - Fork 747
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
Disposable interfaces #964
Disposable interfaces #964
Conversation
Weirdly,
|
Hi, yes the default (empty) constructor should not. HttpClient created through HttpClientFactory has shorter lifetime with different internal behaviour. |
@trejjam is correct, a generated client is injected with a new HttpClient instance each time it's created. The instance contains client specific base address, timeout, headers, and pipeline handlers. The underlying HttpMessageHandler is performing the actual requests and is managed by the HttpClientFactory.
|
Looks like I have some reading to do. 😳 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What kind of change does this PR introduce?
Feature, resolve #660. A generated client has an implementation of
IDisposable.Dispose
(if interface is marked asIDisposable
)What is the current behavior?
IDispose
is not generated, when necessary.What is the new behavior?
Interface marked with
IDisposable
has implementedIDispose
methodWhat might this PR break?
Nothing
Please check if the PR fulfills these requirements
Other information:
This feature is handling following messages when
AddRefitClient
is used for registration (HttpClient
is created usingIHttpClientFactory
)