In an example project (https://github.com/dotnet-architecture/eShopOnContainers) I saw that, during service registration, the author of the code was able to register a service with blank type parameters like this:
services.AddScoped(typeof(IAsyncRepository<>), typeof(EfRepository<>));
so that a service could be injected like this:
public OrderService(IAsyncRepository<Basket> basketRepository, ...)
{
...
}
The use of IAsyncRepository <> confuses me. I've been trying to google this as "blank type parameters" because I'm not sure what this is even called.
I can't find any documentation on using "blank type parameters" or how the service container is able to work out how to inject an IAsyncRepository with the correct type parameters.
Could anyone explain how this is working, first of all, and if are there other common use-cases besides generic repository services for these "blank type parameters"?