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

Transient lifetime services are created each time they’re requested. This lifetime works best for lightweight, stateless services.

services.AddTransient<IService, Service>();

Scoped

Scoped lifetime services are created once per request.

services.AddScoped<IUsersService, UsersService>();
services.AddScoped<IAppRepository, AppRepository>();

Singleton

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.

services.AddSingleton<IConfiguration>(Configuration);

Reference:https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection