services.AddSingleton();
services.AddScoped();
services.AddTransientThis example shows how to register a transient service. `IService` is the interface of the service, and `Service` is the concrete implementation. The transient lifetime means that a new instance of the service will be created every time it's requested. Package library: Microsoft.Extensions.DependencyInjection In all three examples, `services` is an instance of `IServiceCollection` and used to register services to the DI container. The name of the package library is determined by the namespace and using statements at the top of the file. In this case, it is `Microsoft.Extensions.DependencyInjection`.();