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