Generics let one type describe reusable behavior for multiple types. An open generic, such as Repository<T>, keeps T unspecified until the dependency-injection container resolves a concrete request. section 9.2
In dependency injection, requesting IRepository<Customer> can produce DbRepository<Customer>. Register open generic implementations with the typeof overload rather than the usual generic registration methods. section 9.2
Register an open generic
builder.Services.AddScoped(typeof(IRepository<>), typeof(DbRepository<>)); This registration tells the container to pair each requested IRepository<T> with the matching DbRepository<T>. section 9.2



















