Replies: 1 comment
-
@hfloyd Sometimes dependency injection feels like dark magic. I'm not sure if this helps or not, but here's how I had to do it on the By injecting the var tagQuery = _httpContextAccessor.HttpContext.RequestServices.GetRequiredService<ITagQuery>(); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a custom IDataListSource , but after compiling, the site fails to load with the error:
The issue seems to be with Dependency Injection - I was injecting a custom Service into the IDataListSource. If I remove that service from the CTOR, the error doesn't occur.
The custom service is initiated in the "Startup.cs", and works in other contexts, so I am trying to pinpoint why it is blowing up here.
I have tried declaring it as
services.AddSingleton<MyService>()
; and asservices.AddScoped<MyService>();
but neither works.Has anyone else come across this sort of issue and have any insights?
Beta Was this translation helpful? Give feedback.
All reactions