C
C#7mo ago
Ares

✅ Help with depedency injection?

So I made an ILoginRepository and then SQLLoginRepository for login/logout routes, I am using Google provider. however, it seems liek the Dependency injection is failing, and I'm not sure why. I've spend about an hour trying to fix it but no luck. Anyone kno why im getting this error:
An unhandled exception occurred while processing the request.
InvalidOperationException: Unable to resolve service for type 'RealTimePolls.Repositories.SQLLoginRepository' while attempting to activate 'RealTimePolls.Controllers.LoginController'.
Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ThrowHelperUnableToResolveService(Type type, Type requiredBy)
An unhandled exception occurred while processing the request.
InvalidOperationException: Unable to resolve service for type 'RealTimePolls.Repositories.SQLLoginRepository' while attempting to activate 'RealTimePolls.Controllers.LoginController'.
Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ThrowHelperUnableToResolveService(Type type, Type requiredBy)
4 Replies
Jimmacle
Jimmacle7mo ago
your LoginController is asking for a SQLLoginRepository instead of a ILoginRepository
Ares
AresOP7mo ago
oh lol i knew it was somethign dumb liek that but couldnt figur eit out so thx
SleepWellPupper
SleepWellPupper7mo ago
$close
MODiX
MODiX7mo ago
If you have no further questions, please use /close to mark the forum thread as answered
Want results from more Discord servers?
Add your server