Hi,
I have a service (service1) that is added to dependency injection as a singleton class at the start up (startup.cs). I am also implementing IViewLocationExpander (BrandLocationExpandor) in order to do some View location management. I need service1 that is injected at the startup to be available in the BrandLocationExpandor. How can I inject this as I cannot inject it like in a controller and I have the following in the startup.cs
services.AddSingleton<IService1, service1>();
services.Configure<RazorViewEngineOptions>(options =>
{
options.ViewLocationExpanders.Add(new BrandLocationExpander());
});
Is there any way I can inject service1 into the above new BrandLocationExpander()
Many thanks
Angelo