services.AddTransient();
services.AddTransientIn this example, we are registering a transient service called "IUnitOfWork" using the provided lambda expression. Every time a request is made for "IUnitOfWork", a new instance of "UnitOfWork" will be created with the provided connection string. The AddTransient method is located in the Microsoft.Extensions.DependencyInjection package library.(sp => new UnitOfWork(connectionString));