C
C#2y ago
NDOT

❔ ✅ Cannot instantiate implementation type

probably i just mess a simple thing, but idk how to fix it uwucs
7 Replies
NDOT
NDOT2y ago
i just started a simple aspnetcore api
Thinker
Thinker2y ago
Have you added an IUserRepository to DI? Something like builder.Services.AddScoped<IUserRepository, UserRepository>(); can you show your Program.cs?
NDOT
NDOT2y ago
damn i find the error instead of
builder.Services.AddScoped<IUserRepository, UserRepository>();
builder.Services.AddScoped<IUserRepository, UserRepository>();
i was using
builder.Services.AddScoped<IUserRepository, IUserRepository>();
builder.Services.AddScoped<IUserRepository, IUserRepository>();
IUserRepository>UserRepository lol
Thinker
Thinker2y ago
yeah that'll do it
NDOT
NDOT2y ago
thanks a lot bro
Thinker
Thinker2y ago
np catsip
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.