We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying to follow the directions of Using HttpClientFactory
I have services.AddRefitClient<IWebApi>(settings) .ConfigureHttpClient(c => c.BaseAddress = new Uri("https://api.myapi.com")); in my startup class.
services.AddRefitClient<IWebApi>(settings) .ConfigureHttpClient(c => c.BaseAddress = new Uri("https://api.myapi.com"));
and my service class
public class ApiService { public ApiService(IWebApi webApi) { _webApi = webApi; } private readonly IWebApi _webApi; public async Task<IActionResult> Index(CancellationToken cancellationToken) { var thing = await _webApi.GetSomethingWeNeed(cancellationToken); return View(thing); } }
I get an error when I try to create an instance of the ApiService in a View saying that there is not a constructor with 0 parameters.
What am I missing on the DI or Refit side?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying to follow the directions of Using HttpClientFactory
I have
services.AddRefitClient<IWebApi>(settings) .ConfigureHttpClient(c => c.BaseAddress = new Uri("https://api.myapi.com"));
in my startup class.and my service class
I get an error when I try to create an instance of the ApiService in a View saying that there is not a constructor with 0 parameters.
What am I missing on the DI or Refit side?
The text was updated successfully, but these errors were encountered: