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