I'm building an application with ASP.Net Core 2.1 and I'm using autofac instead the built-in DI container.
Now I have a doubt: if I have a library that provides extension methods for IServiceCollection, how can I use it in autofac?
In my case I would like to add the Refit library to create some REST clients. From the documentation the client should be added in the DI engine with the following extension method
services.AddRefitClient<ICountryRepository>()
.ConfigureHttpClient(c => c.BaseAddress = new Uri(Configuration.GetSection("Apis:CountryApi:Url").Value));
How can I do the same with autofac? In general is there a way to use the IServiceCollection extension methods in autofac registrations?
I cannot register the dependency in ConfigureService method because my project is divided into several dlls and the registration in this case logically belongs in another dll not referenced. (The division into modules is one of the reasons why I chose Autofac)
Thanks