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

Inherit from HttpClientWrapper #34

Closed
DeadlyEmbrace opened this issue Jun 11, 2018 · 0 comments
Closed

Inherit from HttpClientWrapper #34

DeadlyEmbrace opened this issue Jun 11, 2018 · 0 comments
Assignees

Comments

@DeadlyEmbrace
Copy link
Member

Description

VaraniumSharp provides an IHttpClient that wraps around HttpClient to make it injectable, however the class is disposable and DryIoC does not allow direct injection of disposable transients without explicitly registering them. Currently each implementation has to create a custom wrapper, however it is simple enough to provide a generic wrapper in Initiator as follows

using VaraniumSharp.Attributes;
using VaraniumSharp.Initiator.Attributes;
using VaraniumSharp.Wrappers;
using IHttpClient = VaraniumSharp.Interfaces.Wrappers.IHttpClient;

namespace Namespace
{
    /// <inheritdoc />
    [AutomaticContainerRegistration(typeof(IHttpClient), Priority = 1)]
    [DisposableTransient]
    public class HttpClientInjectableWrapper : HttpClientWrapper
    {
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant