1 implementation of IService
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
2948private class Service : IService { }
8 references to IService
Microsoft.AspNetCore.Tests (8)
WebApplicationTests.cs (8)
1499services.AddSingleton<IService, Service>(); 1510var service0 = app.Services.GetRequiredService<IService>(); 1512var service1 = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider().GetRequiredService<IService>(); 1819Assert.Throws<InvalidOperationException>(() => builder.Services.AddSingleton<IService>(new Service())); 1821Assert.Throws<InvalidOperationException>(() => builder.Services.AddScoped<IService, Service>()); 1822Assert.Throws<InvalidOperationException>(() => builder.Services.TryAddScoped<IService, Service>());