With dotnet’s built in Dependency Injection (DI), you have the choice to wire up dependencies with three different flavors of binding. Here’s a quick reference for how those bindings work.
Transient lifetime services are created each time they’re requested. This lifetime works best for lightweight, stateless services.
Scoped lifetime services are created once per request.
services.AddScoped<IUsersService, UsersService>(); services.AddScoped<IAppRepository, AppRepository>();
Singleton lifetime services are created the first time they’re requested (or when ConfigureServices is run if you specify an instance there) and then every subsequent request will use the same instance.