❔ ✅ Cannot instantiate implementation type

CCavalcanti2/15/2023
probably i just mess a simple thing, but idk how to fix it :uwucs:
Image
CCavalcanti2/15/2023
i just started a simple aspnetcore api
Tthinker2272/15/2023
Have you added an IUserRepository to DI?
Tthinker2272/15/2023
Something like builder.Services.AddScoped<IUserRepository, UserRepository>();
Tthinker2272/15/2023
can you show your Program.cs?
CCavalcanti2/15/2023
damn
CCavalcanti2/15/2023
i find the error
CCavalcanti2/15/2023
instead of
       builder.Services.AddScoped<IUserRepository, UserRepository>();

i was using
       builder.Services.AddScoped<IUserRepository, IUserRepository>();
CCavalcanti2/15/2023
IUserRepository>UserRepository
CCavalcanti2/15/2023
lol
Tthinker2272/15/2023
yeah that'll do it
CCavalcanti2/15/2023
thanks a lot bro
Tthinker2272/15/2023
np :catsip:
AAccord2/16/2023
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.