Skip to main content
C# / .NET Code Completion Hard +35 XP

Dependency Injection

Complete the constructor injection registration.

C# / .NETFill in the blank
builder.Services.___(IUserService, UserService);

Type the missing code

Show answer and explanation

Answer: AddScoped<

AddScoped<TInterface, TImplementation>() registers a service with scoped lifetime — one instance per HTTP request in ASP.NET Core.

Hint: Which DI method creates one instance per request?

What this challenge tests

Code Completion in C# / .NET: dependency-injection, aspnet.

Related challenges