Reputation: 59
This is my project structure:
I want to know how I can add repository to AddTransient
public void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IDrinkRepository Implementation>();
services.AddMvc();
}
Upvotes: 1
Views: 915
Reputation: 5265
I left the (semi-pseudo) code as is.
You'd use it as follows:
services.AddTransient<IDrinkRepository, DrinkRepository>();
where DrinkRepository
is a concrete implementation of IDrinkRepository
.
Does that answer your question?
Upvotes: 2