1103 references to BuildServiceProvider
Aspire.EndToEnd.Tests (1)
tests\Shared\WorkloadTesting\AspireProject.cs (1)
493return services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>().CreateClient();
Aspire.Hosting.Testing.Tests (2)
DistributedApplicationHttpClientExtensionsForTests.cs (1)
28return services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>();
ResourceLoggerForwarderServiceTests.cs (1)
129return new ResourceNotificationService(NullLogger<ResourceNotificationService>.Instance, hostApplicationLifetime, new ServiceCollection().BuildServiceProvider(), resourceLoggerService);
Aspire.Hosting.Tests (6)
Dashboard\DashboardServiceTests.cs (4)
32var resourceNotificationService = new ResourceNotificationService(NullLogger<ResourceNotificationService>.Instance, new TestHostApplicationLifetime(), new ServiceCollection().BuildServiceProvider(), resourceLoggerService); 33var dashboardServiceData = new DashboardServiceData(resourceNotificationService, resourceLoggerService, NullLogger<DashboardServiceData>.Instance, new DashboardCommandExecutor(new ServiceCollection().BuildServiceProvider())); 84var resourceNotificationService = new ResourceNotificationService(loggerFactory.CreateLogger<ResourceNotificationService>(), new TestHostApplicationLifetime(), new ServiceCollection().BuildServiceProvider(), resourceLoggerService); 85using var dashboardServiceData = new DashboardServiceData(resourceNotificationService, resourceLoggerService, loggerFactory.CreateLogger<DashboardServiceData>(), new DashboardCommandExecutor(new ServiceCollection().BuildServiceProvider()));
ResourceCommandAnnotationTests.cs (1)
54ServiceProvider = new ServiceCollection().BuildServiceProvider()
tests\Aspire.Hosting.Testing.Tests\DistributedApplicationHttpClientExtensionsForTests.cs (1)
28return services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>();
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationExtensions.cs (1)
199.BuildServiceProvider();
Aspire.Workload.Tests (1)
tests\Shared\WorkloadTesting\AspireProject.cs (1)
493return services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>().CreateClient();
CustomEncryptorSample (1)
Program.cs (1)
20.Services.BuildServiceProvider())
InMemory.FunctionalTests (3)
HttpsConnectionMiddlewareTests.cs (1)
46.BuildServiceProvider();
HttpsTests.cs (1)
43.BuildServiceProvider();
TestTransport\TestServer.cs (1)
137return services.BuildServiceProvider();
InteropClient (1)
InteropClient.cs (1)
105serviceProvider = services.BuildServiceProvider();
IStartupInjectionAssemblyName (1)
Startup.cs (1)
18return services.BuildServiceProvider();
KeyManagementSample (1)
Program.cs (1)
26using (var services = serviceCollection.BuildServiceProvider())
Microsoft.Arcade.Common (1)
MSBuildTaskBase.cs (1)
34using (var provider = collection.BuildServiceProvider())
Microsoft.AspNetCore.Antiforgery.Test (8)
AntiforgeryApplicationBuilderExtensionsTest.cs (1)
57var serviceProvider = services.BuildServiceProvider();
AntiforgeryOptionsSetupTest.cs (2)
27var services = serviceCollection.BuildServiceProvider(); 52var services = serviceCollection.BuildServiceProvider();
DefaultAntiforgeryTest.cs (5)
361context.HttpContext.RequestServices = services.BuildServiceProvider(); 1292context.HttpContext.RequestServices = services.BuildServiceProvider(); 1330context.HttpContext.RequestServices = services.BuildServiceProvider(); 1364context.HttpContext.RequestServices = services.BuildServiceProvider(); 1406return builder.BuildServiceProvider();
Microsoft.AspNetCore.AsyncState.Tests (1)
AsyncContextHttpContextOfTTests.cs (1)
24var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Authentication.Core.Test (27)
AuthenticationSchemeProviderTests.cs (12)
21}).BuildServiceProvider(); 34}).BuildServiceProvider(); 46}).BuildServiceProvider(); 64}).BuildServiceProvider(); 82}).BuildServiceProvider(); 98}).BuildServiceProvider(); 121}).BuildServiceProvider(); 138}).BuildServiceProvider(); 151}).BuildServiceProvider(); 163}).BuildServiceProvider(); 181.BuildServiceProvider(); 199}).BuildServiceProvider();
AuthenticationServiceTests.cs (13)
18}).BuildServiceProvider(); 36.BuildServiceProvider(); 57}).BuildServiceProvider(); 72}).BuildServiceProvider(); 87}).BuildServiceProvider(); 102}).BuildServiceProvider(); 119}).BuildServiceProvider(); 142}).BuildServiceProvider(); 161}).BuildServiceProvider(); 181}).BuildServiceProvider(); 199}).BuildServiceProvider(); 217}).BuildServiceProvider(); 236}).BuildServiceProvider();
TokenExtensionTests.cs (2)
132context.RequestServices = services.BuildServiceProvider(); 145context.RequestServices = services.BuildServiceProvider();
Microsoft.AspNetCore.Authentication.Test (41)
AuthenticationMiddlewareTests.cs (1)
216var serviceProvider = serviceCollection.BuildServiceProvider();
CertificateTests.cs (1)
31var sp = services.BuildServiceProvider();
CookieTests.cs (1)
292var options = services.BuildServiceProvider().GetRequiredService<IOptionsMonitor<CookieAuthenticationOptions>>();
JwtBearerTests_Handler.cs (5)
973var sp = services.BuildServiceProvider(); 1010var sp = services.BuildServiceProvider(); 1037var sp = services.BuildServiceProvider(); 1057var sp = services.BuildServiceProvider(); 1079var sp = services.BuildServiceProvider();
OpenIdConnect\OpenIdConnectConfigurationTests.cs (9)
46var sp = services.BuildServiceProvider(); 93var sp = services.BuildServiceProvider(); 122var sp = services.BuildServiceProvider(); 162var sp = services.BuildServiceProvider(); 202var sp = services.BuildServiceProvider(); 242var sp = services.BuildServiceProvider(); 285var sp = services.BuildServiceProvider(); 340var sp = services.BuildServiceProvider(); 400var sp = services.BuildServiceProvider();
OpenIdConnect\OpenIdConnectTests.cs (5)
440var sp = services.BuildServiceProvider(); 473var sp = services.BuildServiceProvider(); 508var sp = services.BuildServiceProvider(); 531var sp = services.BuildServiceProvider(); 559var sp = services.BuildServiceProvider();
PolicyTests.cs (5)
74var sp = services.BuildServiceProvider(); 130var sp = services.BuildServiceProvider(); 191var sp = services.BuildServiceProvider(); 243var sp = services.BuildServiceProvider(); 300var sp = services.BuildServiceProvider();
SecureDataFormatTests.cs (1)
16ServiceProvider = serviceCollection.BuildServiceProvider();
SharedAuthenticationTests.cs (11)
41var sp = services.BuildServiceProvider(); 105var sp = services.BuildServiceProvider(); 147var sp = services.BuildServiceProvider(); 187var sp = services.BuildServiceProvider(); 237var sp = services.BuildServiceProvider(); 266var sp = services.BuildServiceProvider(); 305var sp = services.BuildServiceProvider(); 347var sp = services.BuildServiceProvider(); 416var sp = services.BuildServiceProvider(); 490var sp = services.BuildServiceProvider(); 541var sp = services.BuildServiceProvider();
WsFederation\WsFederationTest.cs (1)
32var sp = services.BuildServiceProvider();
WsFederation\WsFederationTest_Handler.cs (1)
30var sp = services.BuildServiceProvider();
Microsoft.AspNetCore.Authorization.Test (20)
AuthorizationAppBuilderExtensionsTests.cs (2)
49var app = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); 73var serviceProvder = services.BuildServiceProvider();
AuthorizationBuilderTests.cs (6)
21var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value; 37var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value; 52var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value; 68var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value; 83var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value; 97var options = builder.Services.BuildServiceProvider().GetRequiredService<IOptions<AuthorizationOptions>>().Value;
AuthorizationMiddlewareResultHandlerTests.cs (1)
140var serviceProvider = services.BuildServiceProvider();
AuthorizationMiddlewareTests.cs (5)
253.AddSingleton(CreateDataSource(endpoint)).BuildServiceProvider(); 295.AddSingleton(CreateDataSource(endpoint)).BuildServiceProvider(); 362.AddSingleton(CreateDataSource(endpoint)).BuildServiceProvider(); 997services ??= new ServiceCollection().BuildServiceProvider(); 1044var serviceProvider = serviceCollection.BuildServiceProvider();
DefaultAuthorizationServiceTests.cs (1)
21return services.BuildServiceProvider().GetRequiredService<IAuthorizationService>();
PassThroughAuthorizationHandlerTests.cs (1)
19return services.BuildServiceProvider().GetRequiredService<IAuthorizationService>();
PolicyEvaluatorTests.cs (4)
20context.RequestServices = services.BuildServiceProvider(); 37context.RequestServices = services.BuildServiceProvider(); 56context.RequestServices = services.BuildServiceProvider(); 166return services.BuildServiceProvider().GetRequiredService<IPolicyEvaluator>();
Microsoft.AspNetCore.Components.Authorization.Tests (5)
AuthorizeRouteViewTest.cs (1)
36var services = serviceCollection.BuildServiceProvider();
AuthorizeViewTest.cs (1)
569return new TestRenderer(serviceCollection.BuildServiceProvider());
CascadingAuthenticationStateTest.cs (3)
44var renderer = new TestRenderer(services.BuildServiceProvider()); 77var renderer = new TestRenderer(services.BuildServiceProvider()); 129var renderer = new TestRenderer(services.BuildServiceProvider());
Microsoft.AspNetCore.Components.Endpoints.Tests (12)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (1)
277return collection.BuildServiceProvider();
EndpointHtmlRendererTest.cs (5)
41private readonly IServiceProvider _services = CreateDefaultServiceCollection().BuildServiceProvider(); 670var provider = collection.BuildServiceProvider(); 889.BuildServiceProvider(); 918.BuildServiceProvider(); 1011.BuildServiceProvider();
HotReloadServiceTests.cs (1)
226return services.BuildServiceProvider();
ImportMapTest.cs (1)
24var serviceProvider = services.BuildServiceProvider();
RazorComponentEndpointDataSourceTest.cs (1)
229return services.BuildServiceProvider();
RazorComponentEndpointInvokerTest.cs (1)
25.BuildServiceProvider();
RazorComponentResultTest.cs (1)
471var result = new DefaultHttpContext { RequestServices = serviceCollection.BuildServiceProvider() };
RazorComponentsServiceCollectionExtensionsTest.cs (1)
118var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Components.Performance (1)
RouteTableFactoryBenchmarks.cs (1)
20.BuildServiceProvider();
Microsoft.AspNetCore.Components.Server.Tests (14)
Circuits\CircuitHostTest.cs (7)
420serviceScope: new ServiceCollection().BuildServiceProvider().CreateAsyncScope()); 442serviceScope: new ServiceCollection().BuildServiceProvider().CreateAsyncScope()); 468serviceScope: new ServiceCollection().BuildServiceProvider().CreateAsyncScope()); 495serviceScope: new ServiceCollection().BuildServiceProvider().CreateAsyncScope()); 533serviceScope: new ServiceCollection().BuildServiceProvider().CreateAsyncScope()); 570serviceScope: new ServiceCollection().BuildServiceProvider().CreateAsyncScope()); 647serviceCollection.BuildServiceProvider(),
Circuits\RemoteRendererTest.cs (1)
641return serviceCollection.BuildServiceProvider();
Circuits\RenderBatchWriterTest.cs (1)
388: base(new ServiceCollection().BuildServiceProvider(), NullLoggerFactory.Instance)
ComponentEndpointRouteBuilderExtensionsTest.cs (1)
143var serviceProvider = services.BuildServiceProvider();
DependencyInjection\ComponentServiceCollectionExtensionsTest.cs (4)
21var options = services.BuildServiceProvider().GetRequiredService<IOptions<HubOptions<ComponentHub>>>(); 42var options = services.BuildServiceProvider().GetRequiredService<IOptions<HubOptions<ComponentHub>>>(); 68var options = services.BuildServiceProvider().GetRequiredService<IOptions<HubOptions<ComponentHub>>>(); 69var globalOptions = services.BuildServiceProvider().GetRequiredService<IOptions<HubOptions>>();
Microsoft.AspNetCore.Components.Tests (15)
CascadingParameterTest.cs (8)
452var renderer = new TestRenderer(services.BuildServiceProvider()); 496var renderer = new TestRenderer(services.BuildServiceProvider()); 522var renderer = new TestRenderer(services.BuildServiceProvider()); 562var renderer = new TestRenderer(services.BuildServiceProvider()); 578var renderer = new TestRenderer(services.BuildServiceProvider()); 645var renderer = new TestRenderer(services.BuildServiceProvider()); 700var renderer = new TestRenderer(services.BuildServiceProvider()); 844var renderer = new TestRenderer(services.BuildServiceProvider());
ComponentFactoryTest.cs (1)
261.BuildServiceProvider();
Lifetime\ComponentStatePersistenceManagerTest.cs (1)
239public TestRenderer() : base(new ServiceCollection().BuildServiceProvider(), NullLoggerFactory.Instance)
OwningComponentBaseTest.cs (1)
17var serviceProvider = services.BuildServiceProvider();
RouteViewTest.cs (1)
23var services = serviceCollection.BuildServiceProvider();
Routing\RouterTest.cs (1)
27var serviceProvider = services.BuildServiceProvider();
Routing\RouteTableFactoryTests.cs (2)
20.BuildServiceProvider(); 1126.BuildServiceProvider();
Microsoft.AspNetCore.Components.Web.Tests (10)
Forms\EditFormTest.cs (1)
26_testRenderer = new(services.BuildServiceProvider());
Forms\InputNumberTest.cs (1)
20_testRenderer = new TestRenderer(services.BuildServiceProvider());
Forms\Mapping\FormMappingScopeTest.cs (1)
20var services = serviceCollection.BuildServiceProvider();
Forms\Mapping\SupplyParameterFromFormTest.cs (1)
68return new TestRenderer(services.BuildServiceProvider());
HtmlRendering\HtmlRendererTest.cs (2)
1379serviceProvider = services.BuildServiceProvider(); 1417return services.BuildServiceProvider();
Virtualization\VirtualizeTest.cs (4)
25.BuildServiceProvider(); 44.BuildServiceProvider(); 63.BuildServiceProvider(); 84.BuildServiceProvider();
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Hosting\WebAssemblyHostBuilderTest.cs (1)
183return containerBuilder.ServiceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Components.WebView.Test (5)
WebViewManagerTests.cs (5)
14var services = RegisterTestServices().AddTestBlazorWebView().BuildServiceProvider(); 34var services = RegisterTestServices().AddTestBlazorWebView().BuildServiceProvider(); 56var services = RegisterTestServices().AddTestBlazorWebView().BuildServiceProvider(); 87.BuildServiceProvider(); 102var services = RegisterTestServices().AddTestBlazorWebView().BuildServiceProvider();
Microsoft.AspNetCore.Components.WebViewE2E.Test (1)
BasicBlazorHybridTest.cs (1)
51services: serviceCollection.BuildServiceProvider(),
Microsoft.AspNetCore.DataProtection.Extensions (1)
DataProtectionProvider.cs (1)
143return serviceCollection.BuildServiceProvider().GetRequiredService<IDataProtectionProvider>();
Microsoft.AspNetCore.DataProtection.Tests (25)
ActivatorTests.cs (2)
17var services = serviceCollection.BuildServiceProvider(); 76var actualActivator = serviceCollection.BuildServiceProvider().GetActivator();
DataProtectionUtilityExtensionsTests.cs (4)
37.BuildServiceProvider(); 68.BuildServiceProvider(); 96.BuildServiceProvider(); 119.BuildServiceProvider();
KeyManagement\KeyEscrowServiceProviderExtensionsTests.cs (3)
23var services = new ServiceCollection().BuildServiceProvider(); 44var services = serviceCollection.BuildServiceProvider(); 77var services = serviceCollection.BuildServiceProvider();
ServiceCollectionTests.cs (5)
24.BuildServiceProvider(); 36.BuildServiceProvider(); 42.BuildServiceProvider(); 86.BuildServiceProvider(); 119.BuildServiceProvider();
TypeForwardingActivatorTests.cs (2)
16var services = serviceCollection.BuildServiceProvider(); 33var services = serviceCollection.BuildServiceProvider();
XmlEncryption\CertificateXmlEncryptionTests.cs (1)
41var services = serviceCollection.BuildServiceProvider();
XmlEncryption\EncryptedXmlDecryptorTests.cs (3)
36.BuildServiceProvider(); 54.BuildServiceProvider(); 76.BuildServiceProvider();
XmlEncryption\XmlEncryptionExtensionsTests.cs (5)
42var services = serviceCollection.BuildServiceProvider(); 69var services = serviceCollection.BuildServiceProvider(); 103var services = serviceCollection.BuildServiceProvider(); 135var services = serviceCollection.BuildServiceProvider(); 186var services = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (11)
Latency\AddServerTimingHeaderMiddlewareTests.cs (1)
31.BuildServiceProvider();
Latency\RequestLatencyTelemetryExtensionsTests.cs (2)
36.BuildServiceProvider(); 60.BuildServiceProvider();
Logging\HttpLoggingServiceExtensionsTests.cs (2)
45using var provider = services.BuildServiceProvider(); 77using var provider = services.BuildServiceProvider();
Logging\LoggingOptionsValidationTests.cs (3)
26.BuildServiceProvider(); 42.BuildServiceProvider(); 58.BuildServiceProvider();
Logging\RequestHeadersEnricherExtensionsTests.cs (3)
33.BuildServiceProvider(); 45.BuildServiceProvider(); 61.BuildServiceProvider();
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (5)
GrpcJsonTranscodingServiceExtensionsTests.cs (2)
21var serviceProvider = services.BuildServiceProvider(); 46var serviceProvider = services.BuildServiceProvider();
Infrastructure\TestHelpers.cs (1)
25var serviceProvider = serviceCollection.BuildServiceProvider();
JsonTranscodingServerCallContextTests.cs (1)
62var serviceProvider = serviceCollection.BuildServiceProvider();
JsonTranscodingServiceMethodProviderTests.cs (1)
273IEndpointRouteBuilder endpointRouteBuilder = new TestEndpointRouteBuilder(serviceCollection.BuildServiceProvider());
Microsoft.AspNetCore.Grpc.Swagger.Tests (3)
GrpcSwaggerServiceExtensionsTests.cs (2)
31var serviceProvider = services.BuildServiceProvider(); 67var serviceProvider = services.BuildServiceProvider();
Infrastructure\OpenApiTestHelpers.cs (1)
31var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.HeaderParsing.Tests (13)
HeaderParsingExtensionsTests.cs (5)
23.BuildServiceProvider(); 35.BuildServiceProvider(); 45.BuildServiceProvider(); 55.BuildServiceProvider(); 128RequestServices = services.BuildServiceProvider()
HeaderParsingFeatureTests.cs (2)
29private IHeaderRegistry Registry => _registry ??= new HeaderRegistry(_services.BuildServiceProvider(), _options); 32=> _context ??= new DefaultHttpContext { RequestServices = _services.BuildServiceProvider() };
HeaderRegistryTests.cs (6)
27var registry = new HeaderRegistry(_services.BuildServiceProvider(), _options); 44var registry = new HeaderRegistry(_services.BuildServiceProvider(), _options); 59var registry = new HeaderRegistry(_services.BuildServiceProvider(), _options); 67var registry = new HeaderRegistry(_services.BuildServiceProvider(), _options); 81var registry = new HeaderRegistry(_services.BuildServiceProvider(), _options); 94var registry = new HeaderRegistry(_services.BuildServiceProvider(), _options);
Microsoft.AspNetCore.HeaderPropagation.Tests (1)
HeaderPropagationIntegrationTest.cs (1)
86var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Hosting (4)
Internal\StartupLoader.cs (1)
164return applicationServiceProvider ?? services.BuildServiceProvider();
Internal\WebHost.cs (1)
107_applicationServices = _applicationServiceCollection.BuildServiceProvider();
Startup\StartupBase.cs (1)
41return services.BuildServiceProvider();
WebHostBuilder.cs (1)
200var provider = collection.BuildServiceProvider();
Microsoft.AspNetCore.Hosting.Tests (45)
ConfigureBuilderTests.cs (1)
20.BuildServiceProvider();
Fakes\Startup.cs (3)
59return services.BuildServiceProvider(); 80return services.BuildServiceProvider(); 91return services.BuildServiceProvider();
Fakes\StartupCaseInsensitive.cs (1)
20return services.BuildServiceProvider();
HostingApplicationTests.cs (1)
190httpContextFactory ??= new DefaultHttpContextFactory(services.BuildServiceProvider());
HostingMetricsTests.cs (1)
196httpContextFactory ??= new DefaultHttpContextFactory(services.BuildServiceProvider());
Http\DefaultHttpContextFactoryTests.cs (6)
18.BuildServiceProvider(); 36.BuildServiceProvider(); 57.BuildServiceProvider(); 71.BuildServiceProvider(); 89.BuildServiceProvider(); 107.BuildServiceProvider();
Internal\MyContainer.cs (1)
31_inner = _services.BuildServiceProvider();
StartupManagerTests.cs (28)
25var services = serviceCollection.BuildServiceProvider(); 47var services = serviceCollection.BuildServiceProvider(); 68var services = serviceCollection.BuildServiceProvider(); 93var services = serviceCollection.BuildServiceProvider(); 115var services = serviceCollection.BuildServiceProvider(); 137var services = serviceCollection.BuildServiceProvider(); 223return services.BuildServiceProvider(); 295var services = serviceCollection.BuildServiceProvider(); 317var services = serviceCollection.BuildServiceProvider(); 345.BuildServiceProvider(); 365var services = serviceCollection.BuildServiceProvider(); 392.BuildServiceProvider(); 412var services = serviceCollection.BuildServiceProvider(); 426var services = serviceCollection.BuildServiceProvider(); 441var services = serviceCollection.BuildServiceProvider(); 454var services = serviceCollection.BuildServiceProvider(); 471var services = serviceCollection.BuildServiceProvider(); 489var services = serviceCollection.BuildServiceProvider(); 507var services = serviceCollection.BuildServiceProvider(); 522var services = serviceCollection.BuildServiceProvider(); 536var services = serviceCollection.BuildServiceProvider(); 551var services = serviceCollection.BuildServiceProvider(); 567var services = serviceCollection.BuildServiceProvider(); 583var services = serviceCollection.BuildServiceProvider(); 598var services = serviceCollection.BuildServiceProvider(); 609var services = serviceCollection.BuildServiceProvider(); 619var services = serviceCollection.BuildServiceProvider(); 629var services = serviceCollection.BuildServiceProvider();
WebHostBuilderTests.cs (2)
854IServiceProvider ConfigureServices(IServiceCollection services) => services.BuildServiceProvider(); 1618var provider = containerBuilder.BuildServiceProvider();
WebHostTests.AsyncDisposable.cs (1)
55var provider = new AsyncDisposableServiceProvider(containerBuilder.BuildServiceProvider());
Microsoft.AspNetCore.Http.Connections.Tests (62)
HttpConnectionDispatcherTests.cs (62)
234var builder = new ConnectionBuilder(services.BuildServiceProvider()); 315var builder = new ConnectionBuilder(services.BuildServiceProvider()); 356var builder = new ConnectionBuilder(services.BuildServiceProvider()); 394var builder = new ConnectionBuilder(services.BuildServiceProvider()); 433var builder = new ConnectionBuilder(services.BuildServiceProvider()); 473var builder = new ConnectionBuilder(services.BuildServiceProvider()); 535context.RequestServices = services.BuildServiceProvider(); 537var builder = new ConnectionBuilder(services.BuildServiceProvider()); 604var builder = new ConnectionBuilder(services.BuildServiceProvider()); 667var builder = new ConnectionBuilder(services.BuildServiceProvider()); 721var builder = new ConnectionBuilder(services.BuildServiceProvider()); 782context.RequestServices = services.BuildServiceProvider(); 784var builder = new ConnectionBuilder(services.BuildServiceProvider()); 864var builder = new ConnectionBuilder(services.BuildServiceProvider()); 938var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1012var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1044var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1071var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1107var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1143var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1194var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1288var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1329var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1374var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1415var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1447var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1490var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1555var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1619var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1649var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1684var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1718var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1758var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1807var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1838var sp = services.BuildServiceProvider(); 1890var sp = services.BuildServiceProvider(); 1947var builder = new ConnectionBuilder(services.BuildServiceProvider()); 1991var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2024var services = serviceCollection.BuildServiceProvider(); 2064var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2117var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2170var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2388var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2462var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2556var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2618var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2675var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2734var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2776var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2826var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2853var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2883var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2932var builder = new ConnectionBuilder(services.BuildServiceProvider()); 2964var builder = new ConnectionBuilder(services.BuildServiceProvider()); 3021var builder = new ConnectionBuilder(services.BuildServiceProvider()); 3076var builder = new ConnectionBuilder(services.BuildServiceProvider()); 3119var builder = new ConnectionBuilder(services.BuildServiceProvider()); 3153var builder = new ConnectionBuilder(services.BuildServiceProvider()); 3575var builder = new ConnectionBuilder(services.BuildServiceProvider()); 3704context.RequestServices = services.BuildServiceProvider(); 3706var builder = new ConnectionBuilder(services.BuildServiceProvider()); 3746context.RequestServices = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Http.Extensions.Tests (24)
ProblemDetailsDefaultWriterTest.cs (1)
698return services.BuildServiceProvider();
ProblemDetailsServiceCollectionExtensionsTest.cs (6)
97var services = collection.BuildServiceProvider(); 122var services = collection.BuildServiceProvider(); 162var services = collection.BuildServiceProvider(); 183var services = collection.BuildServiceProvider(); 203var services = collection.BuildServiceProvider(); 228var services = collection.BuildServiceProvider();
RequestDelegateFactoryTests.cs (8)
1177var services = serviceCollection.BuildServiceProvider(); 1345.BuildServiceProvider(); 1377.BuildServiceProvider(); 1406.BuildServiceProvider(); 1744var services = serviceCollection.BuildServiceProvider(); 3019var serviceProvider = new ServiceCollection().AddSingleton(metadataService).BuildServiceProvider(); 3034var serviceProvider = new ServiceCollection().AddSingleton(metadataService).BuildServiceProvider(); 3262RequestServices = new ServiceCollection().AddSingleton(LoggerFactory).BuildServiceProvider(),
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
216return serviceCollection.BuildServiceProvider();
RequestDelegateGenerator\RequestDelegateCreationTests.cs (3)
272var services = serviceCollection.BuildServiceProvider(); 301var services = serviceCollection.BuildServiceProvider(); 302var emptyServices = new ServiceCollection().BuildServiceProvider();
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (2)
361services.AddSingleton(metadataService).BuildServiceProvider(); 381services.AddSingleton(metadataService).BuildServiceProvider();
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (3)
649.BuildServiceProvider(); 672.BuildServiceProvider(); 760.BuildServiceProvider();
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
216return serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Http.Results.Tests (47)
AcceptedAtRouteOfTResultTests.cs (1)
224return services.BuildServiceProvider();
AcceptedAtRouteResultTests.cs (1)
134return services.BuildServiceProvider();
AcceptedOfTResultTests.cs (1)
147return services.BuildServiceProvider();
AcceptedResultTests.cs (1)
90return services.BuildServiceProvider();
BadRequestOfTResultTests.cs (1)
183return services.BuildServiceProvider();
BadRequestResultTests.cs (1)
96return services.BuildServiceProvider();
ChallengeResultTests.cs (1)
60.BuildServiceProvider();
ConflictOfTResultTests.cs (1)
161return services.BuildServiceProvider();
ConflictResultTests.cs (1)
97return services.BuildServiceProvider();
ContentResultTests.cs (1)
183httpContext.RequestServices = services.BuildServiceProvider();
CreatedAtRouteOfTResultTests.cs (1)
194return services.BuildServiceProvider();
CreatedAtRouteResultTests.cs (1)
140return services.BuildServiceProvider();
CreatedOfTResultTests.cs (1)
190return services.BuildServiceProvider();
CreatedResultTests.cs (1)
127return services.BuildServiceProvider();
EmptyResultTests.cs (1)
48return new ServiceCollection().BuildServiceProvider();
FileContentResultTests.cs (1)
32.BuildServiceProvider();
ForbidResultTests.cs (1)
127.BuildServiceProvider();
HttpResultsHelperTests.cs (1)
246return services.BuildServiceProvider();
InternalServerErrorOfTResultTests.cs (1)
183return services.BuildServiceProvider();
InternalServerErrorResultTests.cs (1)
96return services.BuildServiceProvider();
JsonResultTests.cs (1)
318return services.BuildServiceProvider();
LocalRedirectResultTests.cs (1)
125return serviceCollection.BuildServiceProvider();
NoContentResultTests.cs (1)
102httpContext.RequestServices = services.BuildServiceProvider();
NotFoundOfTResultTests.cs (1)
152return services.BuildServiceProvider();
NotFoundResultTests.cs (1)
101return services.BuildServiceProvider();
OkOfTResultTests.cs (1)
160return services.BuildServiceProvider();
OkResultTests.cs (1)
95return services.BuildServiceProvider();
ProblemResultTests.cs (2)
54.BuildServiceProvider(); 262return services.BuildServiceProvider();
PushStreamResultTests.cs (1)
19RequestServices = new ServiceCollection().AddLogging().BuildServiceProvider()
RedirectToRouteResultTests.cs (2)
19httpContext.RequestServices = CreateServices(null).BuildServiceProvider(); 103httpContext.RequestServices = services.BuildServiceProvider();
ResultsOfTTests.cs (1)
67RequestServices = services.BuildServiceProvider()
SignInResultTests.cs (1)
93.BuildServiceProvider();
SignOutResultTests.cs (1)
92.BuildServiceProvider();
src\Shared\ResultsTests\FileContentResultTestBase.cs (1)
366httpContext.RequestServices = services.BuildServiceProvider();
src\Shared\ResultsTests\FileStreamResultTestBase.cs (1)
454httpContext.RequestServices = services.BuildServiceProvider();
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (1)
471httpContext.RequestServices = services.BuildServiceProvider();
src\Shared\ResultsTests\RedirectResultTestBase.cs (1)
66return serviceCollection.BuildServiceProvider();
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
503httpContext.RequestServices = services.BuildServiceProvider();
StatusCodeResultTests.cs (1)
59httpContext.RequestServices = services.BuildServiceProvider();
UnauthorizedResultTests.cs (1)
69httpContext.RequestServices = services.BuildServiceProvider();
UnprocessableEntityOfTResultTests.cs (1)
160return services.BuildServiceProvider();
UnprocessableEntityResultTests.cs (1)
96return services.BuildServiceProvider();
Utf8ContentResultTests.cs (1)
101httpContext.RequestServices = services.BuildServiceProvider();
ValidationProblemResultTests.cs (2)
58.BuildServiceProvider(); 188return services.BuildServiceProvider();
Microsoft.AspNetCore.Http.Tests (6)
ApplicationBuilderTests.cs (2)
84var serviceProvider = services.BuildServiceProvider(); 110var serviceProvider = services.BuildServiceProvider();
DefaultHttpContextTests.cs (3)
192.BuildServiceProvider(); 208.BuildServiceProvider(); 235.BuildServiceProvider());
ResponseCookiesTest.cs (1)
36features.Set<IServiceProvidersFeature>(new ServiceProvidersFeature() { RequestServices = services.BuildServiceProvider() });
Microsoft.AspNetCore.HttpLogging.Tests (3)
HttpLoggingServicesExtensionsTests.cs (3)
29var serviceProvider = services.BuildServiceProvider(); 41var serviceProvider = services.BuildServiceProvider(); 55var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.HttpOverrides.Tests (2)
CertificateForwardingTest.cs (2)
23var options = services.BuildServiceProvider().GetRequiredService<IOptions<CertificateForwardingOptions>>(); 33var options = services.BuildServiceProvider().GetRequiredService<IOptions<CertificateForwardingOptions>>();
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (17)
CustomSchemaTest.cs (1)
33_builder = new ApplicationBuilder(services.BuildServiceProvider());
DbUtil.cs (1)
38var serviceProvider = ConfigureDbServices<TContext>(connection, services).BuildServiceProvider();
DefaultPocoTest.cs (1)
32var provider = services.BuildServiceProvider();
EmptySchemaTest.cs (1)
33_builder = new ApplicationBuilder(services.BuildServiceProvider());
MaxKeyLengthSchemaTest.cs (1)
32_builder = new ApplicationBuilder(services.BuildServiceProvider());
UserOnlyCustomContextTest.cs (1)
76var provider = services.BuildServiceProvider();
UserOnlyTest.cs (1)
37var provider = services.BuildServiceProvider();
UserStoreEncryptPersonalDataTest.cs (2)
192var applicationServiceProvider = services.BuildServiceProvider(); 287.UseApplicationServiceProvider(services.BuildServiceProvider())
UserStoreGuidKeyTest.cs (2)
63var sp = services.BuildServiceProvider(); 80var sp = services.BuildServiceProvider();
UserStoreIntKeyTest.cs (2)
41var sp = services.BuildServiceProvider(); 58var sp = services.BuildServiceProvider();
UserStoreStringKeyTest.cs (2)
42var sp = services.BuildServiceProvider(); 59var sp = services.BuildServiceProvider();
VersionOneSchemaTest.cs (1)
34_builder = new ApplicationBuilder(services.BuildServiceProvider());
VersionTwoSchemaTest.cs (1)
35_builder = new ApplicationBuilder(services.BuildServiceProvider());
Microsoft.AspNetCore.Identity.InMemory.Test (3)
ControllerTest.cs (3)
40var app = new ApplicationBuilder(services.BuildServiceProvider()); 91var app = new ApplicationBuilder(services.BuildServiceProvider()); 111context.RequestServices = new ServiceCollection().AddSingleton(auth.Object).BuildServiceProvider();
Microsoft.AspNetCore.Identity.Specification.Tests (2)
IdentitySpecificationTestBase.cs (1)
91return services.BuildServiceProvider().GetService<RoleManager<TRole>>();
UserManagerSpecificationTests.cs (1)
90return services.BuildServiceProvider().GetService<UserManager<TUser>>();
Microsoft.AspNetCore.Identity.Test (34)
IdentityBuilderTest.cs (16)
21var sp = services.BuildServiceProvider(); 47var sp = services.BuildServiceProvider(); 59var thingy = services.BuildServiceProvider().GetRequiredService<IUserStore<PocoUser>>() as MyUberThingy; 69var thingy = services.BuildServiceProvider().GetRequiredService<IRoleStore<PocoRole>>() as MyUberThingy; 84var thingy = services.BuildServiceProvider().GetRequiredService<IUserClaimsPrincipalFactory<PocoUser>>() as MyClaimsPrincipalFactory; 100var thingy = services.BuildServiceProvider().GetRequiredService<IUserConfirmation<PocoUser>>() as MyUserConfirmation; 110var thingy = services.BuildServiceProvider().GetRequiredService<IRoleValidator<PocoRole>>() as MyUberThingy; 120var thingy = services.BuildServiceProvider().GetRequiredService<IUserValidator<PocoUser>>() as MyUberThingy; 130var thingy = services.BuildServiceProvider().GetRequiredService<IPasswordValidator<PocoUser>>() as MyUberThingy; 142var myUserManager = services.BuildServiceProvider().GetRequiredService(typeof(UserManager<PocoUser>)) as MyUserManager; 154var myRoleManager = services.BuildServiceProvider().GetRequiredService<RoleManager<PocoRole>>() as MyRoleManager; 171var myUserManager = services.BuildServiceProvider().GetRequiredService(typeof(SignInManager<PocoUser>)) as MySignInManager; 185var provider = services.BuildServiceProvider(); 210var provider = services.BuildServiceProvider(); 230var provider = services.BuildServiceProvider(); 245var provider = services.BuildServiceProvider();
IdentityOptionsTest.cs (3)
42var serviceProvider = services.BuildServiceProvider(); 62var serviceProvider = services.BuildServiceProvider(); 82var serviceProvider = services.BuildServiceProvider();
SecurityStampValidatorTest.cs (7)
61httpContext.Setup(c => c.RequestServices).Returns(new ServiceCollection().BuildServiceProvider()); 124httpContext.Setup(c => c.RequestServices).Returns(services.BuildServiceProvider()); 177httpContext.Setup(c => c.RequestServices).Returns(services.BuildServiceProvider()); 219httpContext.Setup(c => c.RequestServices).Returns(services.BuildServiceProvider()); 256httpContext.Setup(c => c.RequestServices).Returns(services.BuildServiceProvider()); 294httpContext.Setup(c => c.RequestServices).Returns(services.BuildServiceProvider()); 344httpContext.Setup(c => c.RequestServices).Returns(services.BuildServiceProvider());
SignInManagerTest.cs (1)
808context.RequestServices = new ServiceCollection().AddSingleton(auth.Object).BuildServiceProvider();
UserManagerTest.cs (7)
24var manager = services.BuildServiceProvider().GetRequiredService<UserManager<PocoUser>>(); 43var provider = services.BuildServiceProvider(); 800var manager = services.BuildServiceProvider().GetService<UserManager<PocoUser>>(); 811var e = Assert.Throws<InvalidOperationException>(() => services.BuildServiceProvider().GetService<UserManager<PocoUser>>()); 822var e = Assert.Throws<InvalidOperationException>(() => services.BuildServiceProvider().GetService<UserManager<PocoUser>>()); 897var manager = services.BuildServiceProvider().GetService<UserManager<PocoUser>>(); 1754var manager = services.BuildServiceProvider().GetRequiredService<UserManager<PocoUser>>();
Microsoft.AspNetCore.InternalTesting (2)
AssemblyTestLog.cs (2)
180return serviceCollection.BuildServiceProvider(); 209var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.InternalTesting.Tests (2)
LoggedTestXunitTests.cs (1)
114Assert.Same(loggerFactory, serviceCollection.BuildServiceProvider().GetRequiredService<ILoggerFactory>());
XunitLoggerProviderTest.cs (1)
90.BuildServiceProvider()
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1536var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.Core.Test (105)
AcceptedAtActionResultTests.cs (1)
277return services.BuildServiceProvider();
AcceptedAtRouteResultTests.cs (1)
185return services.BuildServiceProvider();
AcceptedResultTests.cs (1)
142return services.BuildServiceProvider();
ActionConstraints\ActionConstraintCacheTest.cs (1)
154return new ServiceCollection().BuildServiceProvider();
ApplicationModels\EndpointMetadataProviderTest.cs (1)
273var serviceProvider = services.BuildServiceProvider();
Authorization\AuthorizeFilterTest.cs (6)
429var result = factory.CreateInstance(new ServiceCollection().BuildServiceProvider()); 445var result = factory.CreateInstance(new ServiceCollection().BuildServiceProvider()); 478.BuildServiceProvider(); 499.BuildServiceProvider(); 554.BuildServiceProvider(); 608var serviceProvider = serviceCollection.BuildServiceProvider();
Builder\MvcApplicationBuilderExtensionsTest.cs (2)
42var serviceProvider = services.BuildServiceProvider(); 67var serviceProvider = services.BuildServiceProvider();
Builder\MvcAreaRouteBuilderExtensionsTest.cs (1)
274return services.BuildServiceProvider();
ChallengeResultTest.cs (2)
27.Returns(CreateServices().AddSingleton(auth.Object).BuildServiceProvider()); 52.Returns(CreateServices().AddSingleton(auth.Object).BuildServiceProvider());
ContentResultTest.cs (1)
279httpContext.RequestServices = services.BuildServiceProvider();
ControllerBaseTest.cs (1)
3202RequestServices = services.BuildServiceProvider()
Controllers\ControllerActivatorProviderTest.cs (1)
51.BuildServiceProvider();
Controllers\ControllerBinderDelegateProviderTest.cs (1)
1259RequestServices = services.BuildServiceProvider()
CreatedAtActionResultTests.cs (1)
97return services.BuildServiceProvider();
CreatedAtRouteResultTests.cs (1)
111return services.BuildServiceProvider();
CreatedResultTests.cs (1)
144return services.BuildServiceProvider();
DependencyInjection\MvcBuilderExtensionsTest.cs (1)
154BuildServiceProvider()
DependencyInjection\MvcCoreBuilderExtensionsTest.cs (1)
97BuildServiceProvider()
FileContentResultTest.cs (1)
36.BuildServiceProvider();
FileResultHelperTest.cs (3)
81.BuildServiceProvider(); 125httpContext.RequestServices = new ServiceCollection().BuildServiceProvider(); 473httpContext.RequestServices = services.BuildServiceProvider();
FileStreamResultTest.cs (1)
27.BuildServiceProvider();
Filters\MiddlewareFilterAttributeTest.cs (1)
18var serviceProvider = services.BuildServiceProvider();
Filters\MiddlewareFilterBuilderTest.cs (6)
22var appBuilder = new ApplicationBuilder(services.BuildServiceProvider()); 47var appBuilder = new ApplicationBuilder(services.BuildServiceProvider()); 80var appBuilder = new ApplicationBuilder(services.BuildServiceProvider()); 109var appBuilder = new ApplicationBuilder(services.BuildServiceProvider()); 161var appBuilder = new ApplicationBuilder(services.BuildServiceProvider()); 229var appBuilder = new ApplicationBuilder(services.BuildServiceProvider());
Filters\MiddlewareFilterConfigurationProviderTest.cs (1)
99var serviceProvider = services.BuildServiceProvider();
Filters\MiddlewareFilterTest.cs (2)
313RequestServices = services.BuildServiceProvider() 322var applicationBuilder = new ApplicationBuilder(applicationServices.BuildServiceProvider());
ForbidResultTest.cs (1)
144.BuildServiceProvider();
Formatters\TextOutputFormatterTests.cs (1)
219new DefaultHttpContext() { RequestServices = new ServiceCollection().BuildServiceProvider() },
HttpActionResultTests.cs (1)
33RequestServices = CreateServices().BuildServiceProvider()
HttpNotFoundObjectResultTest.cs (1)
77return services.BuildServiceProvider();
HttpOkObjectResultTest.cs (1)
79return services.BuildServiceProvider();
HttpOkResultTest.cs (1)
30httpContext.RequestServices = CreateServices().BuildServiceProvider();
HttpStatusCodeResultTests.cs (1)
60httpContext.RequestServices = services.BuildServiceProvider();
Infrastructure\ActionSelectorTest.cs (1)
1102var serviceProvider = new ServiceCollection().BuildServiceProvider();
Infrastructure\ControllerActionInvokerTest.cs (1)
1717httpContext.RequestServices = services.BuildServiceProvider();
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (1)
221return services.BuildServiceProvider();
Infrastructure\JsonResultExecutorTestBase.cs (1)
486httpContext.RequestServices = services.BuildServiceProvider();
Infrastructure\ObjectResultExecutorTest.cs (1)
472httpContext.RequestServices = services.BuildServiceProvider();
LocalRedirectResultTest.cs (1)
142return serviceCollection.BuildServiceProvider();
ModelBinding\Binders\BinderTypeModelBinderTest.cs (2)
37.BuildServiceProvider(); 77HttpContext = new DefaultHttpContext() { RequestServices = new ServiceCollection().BuildServiceProvider() },
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (2)
470RequestServices = new ServiceCollection().BuildServiceProvider(), 497RequestServices = new ServiceCollection().BuildServiceProvider(),
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (2)
651RequestServices = new ServiceCollection().BuildServiceProvider(), 678RequestServices = new ServiceCollection().BuildServiceProvider(),
ModelBinding\Binders\HeaderModelBinderTests.cs (1)
344var serviceProvider = services.BuildServiceProvider();
ModelBinding\Binders\ServicesModelBinderTest.cs (1)
48RequestServices = services.BuildServiceProvider(),
ModelBinding\DefaultModelBindingContextTest.cs (1)
164RequestServices = services.BuildServiceProvider()
ModelBinding\ModelBinderFactoryTest.cs (1)
643return services.BuildServiceProvider();
ModelBinding\ModelBindingHelperTest.cs (1)
1502RequestServices = services.BuildServiceProvider()
ModelBinding\ParameterBinderTest.cs (1)
713RequestServices = services.BuildServiceProvider()
ModelBinding\TestModelBinderProviderContext.cs (1)
105return (services.BuildServiceProvider(), mvcOptions);
ModelBinding\Validation\DefaultObjectValidatorTests.cs (1)
582var provider = new ServiceCollection().AddSingleton(service.Object).BuildServiceProvider();
ObjectResultTests.cs (1)
167return services.BuildServiceProvider();
PhysicalFileResultTest.cs (1)
61return services.BuildServiceProvider();
RedirectResultTest.cs (1)
31return serviceCollection.BuildServiceProvider();
RedirectToActionResultTest.cs (4)
29.Returns(CreateServices().BuildServiceProvider()); 64.Returns(CreateServices().BuildServiceProvider()); 92RequestServices = CreateServices().BuildServiceProvider(), 120RequestServices = CreateServices().BuildServiceProvider(),
RedirectToPageResultTest.cs (1)
307return services.BuildServiceProvider();
RedirectToRouteResultTest.cs (3)
29httpContext.SetupGet(o => o.RequestServices).Returns(CreateServices().BuildServiceProvider()); 64.Returns(CreateServices().BuildServiceProvider()); 170httpContext.RequestServices = services.BuildServiceProvider();
RequireHttpsAttributeTests.cs (1)
242return services.BuildServiceProvider();
Routing\ActionEndpointDataSourceBaseTest.cs (1)
147var serviceProvider = services.BuildServiceProvider();
Routing\ActionEndpointFactoryTest.cs (1)
28Services = serviceCollection.BuildServiceProvider();
Routing\AttributeRouteTest.cs (2)
771.BuildServiceProvider(); 813.BuildServiceProvider();
Routing\AttributeRoutingTest.cs (1)
182.BuildServiceProvider();
Routing\ControllerLinkGeneratorExtensionsTest.cs (1)
221return services.BuildServiceProvider();
Routing\DynamicControllerEndpointMatcherPolicyTest.cs (2)
75Services = services.BuildServiceProvider(); 229RequestServices = new ServiceCollection().AddScoped(sp => new CustomTransformer { State = "Invalid" }).BuildServiceProvider(),
Routing\EndpointRoutingUrlHelperTest.cs (1)
289return services.BuildServiceProvider();
Routing\KnownRouteValueConstraintTests.cs (1)
36var serviceProvider = services.BuildServiceProvider();
Routing\PageLinkGeneratorExtensionsTest.cs (1)
191return services.BuildServiceProvider();
Routing\UrlHelperBaseTest.cs (1)
111return services.BuildServiceProvider();
Routing\UrlHelperTest.cs (1)
16return services.BuildServiceProvider();
ServiceFilterAttributeTest.cs (2)
18.BuildServiceProvider(); 35.BuildServiceProvider();
SignInResultTest.cs (1)
105.BuildServiceProvider();
SignOutResultTest.cs (1)
170.BuildServiceProvider();
src\Shared\ResultsTests\FileContentResultTestBase.cs (1)
366httpContext.RequestServices = services.BuildServiceProvider();
src\Shared\ResultsTests\FileStreamResultTestBase.cs (1)
454httpContext.RequestServices = services.BuildServiceProvider();
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (1)
471httpContext.RequestServices = services.BuildServiceProvider();
src\Shared\ResultsTests\RedirectResultTestBase.cs (1)
66return serviceCollection.BuildServiceProvider();
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
503httpContext.RequestServices = services.BuildServiceProvider();
TypeFilterAttributeTest.cs (3)
20.BuildServiceProvider(); 42.BuildServiceProvider(); 67.BuildServiceProvider();
VirtualFileResultTest.cs (1)
88.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
TestModelBinderFactory.cs (1)
85return services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.Cors.Test (1)
CorsAuthorizationFilterTest.cs (1)
146httpContext.RequestServices = services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (2)
DataAnnotationsModelValidatorTest.cs (1)
402var provider = new ServiceCollection().AddSingleton(service.Object).BuildServiceProvider();
MvcDataAnnotationsMvcOptionsSetup.cs (1)
25var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
XmlDataContractSerializerOutputFormatterTest.cs (1)
809.BuildServiceProvider();
XmlSerializerOutputFormatterTest.cs (1)
591.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.IntegrationTests (4)
AuthorizeFilterIntegrationTest.cs (1)
184return serviceCollection.BuildServiceProvider();
HasValidatorsValidationMetadataProviderIntegrationTest.cs (2)
22var services = serviceCollection.BuildServiceProvider(); 40var services = serviceCollection.BuildServiceProvider();
ModelBindingTestHelper.cs (1)
205return serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.Localization.Test (4)
MvcLocalizationMvcBuilderExtensionsTest.cs (2)
96var serviceProvider = builder.Services.BuildServiceProvider(); 120var serviceProvider = builder.Services.BuildServiceProvider();
MvcLocalizationMvcCoreBuilderExtensionsTest.cs (2)
96var serviceProvider = builder.Services.BuildServiceProvider(); 120var serviceProvider = builder.Services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (6)
JsonResultTest.cs (1)
53httpContext.RequestServices = services.BuildServiceProvider();
NewtonsoftJsonOutputFormatterTest.cs (4)
65.BuildServiceProvider(); 445actionContext.HttpContext.RequestServices = new ServiceCollection().AddLogging().BuildServiceProvider(); 490actionContext.HttpContext.RequestServices = new ServiceCollection().AddLogging().BuildServiceProvider(); 524actionContext.HttpContext.RequestServices = new ServiceCollection().AddLogging().BuildServiceProvider();
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (1)
486httpContext.RequestServices = services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
PageLoaderMatcherPolicyTest.cs (1)
49RequestServices = new ServiceCollection().AddSingleton(loader.Object).BuildServiceProvider(),
Microsoft.AspNetCore.Mvc.Razor.Test (14)
DefaultTagHelperFactoryTest.cs (4)
34var httpContext = MakeHttpContext(services.BuildServiceProvider()); 56var httpContext = MakeHttpContext(services.BuildServiceProvider()); 83var httpContext = MakeHttpContext(services.BuildServiceProvider()); 111var httpContext = MakeHttpContext(services.BuildServiceProvider());
Infrastructure\DefaultTagHelperActivatorTest.cs (1)
25RequestServices = new ServiceCollection().BuildServiceProvider()
RazorHotReloadTest.cs (1)
83.BuildServiceProvider();
RazorPageActivatorTest.cs (1)
253.BuildServiceProvider();
RazorPageCreateModelExpressionTest.cs (1)
320RequestServices = serviceCollection.BuildServiceProvider(),
RazorPageTest.cs (1)
1417.BuildServiceProvider();
RazorViewEngineOptionsTest.cs (2)
33var serviceProvider = services.BuildServiceProvider(); 63var serviceProvider = services.BuildServiceProvider();
RazorViewTest.cs (1)
1791.BuildServiceProvider();
TagHelpers\TagHelperComponentPropertyActivatorTest.cs (1)
54.BuildServiceProvider()
TagHelpers\TagHelperComponentTagHelperTest.cs (1)
392.BuildServiceProvider()
Microsoft.AspNetCore.Mvc.RazorPages.Test (15)
Builder\PageActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
229return collection.BuildServiceProvider();
DependencyInjection\MvcRazorPagesMvcBuilderExtensionsTest.cs (1)
28var serviceProvider = services.BuildServiceProvider();
DependencyInjection\PageConventionCollectionExtensionsTest.cs (1)
981.BuildServiceProvider();
Filters\PageSaveTempDataPropertyFilterFactoryTest.cs (1)
39return serviceCollection.BuildServiceProvider();
Infrastructure\DefaultPageFactoryProviderTest.cs (3)
252.BuildServiceProvider(); 295.BuildServiceProvider(); 333.BuildServiceProvider();
Infrastructure\DefaultPageModelActivatorProviderTest.cs (2)
44RequestServices = serviceCollection.BuildServiceProvider(), 74RequestServices = serviceCollection.BuildServiceProvider(),
Infrastructure\DynamicPageEndpointMatcherPolicyTest.cs (2)
66Services = services.BuildServiceProvider(); 290RequestServices = new ServiceCollection().AddScoped(sp => new CustomTransformer() { State = "Invalid" }).BuildServiceProvider()
Infrastructure\PageActionInvokerTest.cs (1)
1502httpContext.RequestServices = services.BuildServiceProvider();
Infrastructure\PageBinderFactoryTest.cs (1)
790RequestServices = services.BuildServiceProvider()
PageModelTest.cs (1)
1791.BuildServiceProvider();
src\Mvc\Mvc.Core\test\Routing\ActionEndpointDataSourceBaseTest.cs (1)
147var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.TagHelpers.Test (3)
ComponentTagHelperTest.cs (1)
94.BuildServiceProvider(),
DefaultTagHelperActivatorTest.cs (1)
64.BuildServiceProvider();
PersistComponentStateTagHelperTest.cs (1)
265.BuildServiceProvider(),
Microsoft.AspNetCore.Mvc.Test (3)
MvcOptionsSetupTest.cs (1)
301var serviceProvider = serviceCollection.BuildServiceProvider();
MvcServiceCollectionExtensionsTest.cs (2)
263var serviceProvider = services.BuildServiceProvider(); 647var sp = services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (19)
Builder\ControllerActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
302return collection.BuildServiceProvider();
Filters\ControllerSaveTempDataPropertyFilterFactoryTest.cs (1)
35return serviceCollection.BuildServiceProvider();
PageRemoteAttributeTest.cs (5)
45ActionContext = GetActionContext(new ServiceCollection().BuildServiceProvider(), routeData) 83ActionContext = GetActionContext(new ServiceCollection().BuildServiceProvider(), routeData) 115ActionContext = GetActionContext(new ServiceCollection().BuildServiceProvider(), routeData) 146ActionContext = GetActionContext(new ServiceCollection().BuildServiceProvider(), routeData) 164var serviceProvider = serviceCollection.BuildServiceProvider();
PartialViewResultTest.cs (1)
248httpContext.RequestServices = services.BuildServiceProvider();
RemoteAttributeBaseTest.cs (1)
475var serviceProvider = serviceCollection.BuildServiceProvider();
RemoteAttributeTest.cs (3)
367var serviceProvider = serviceCollection.BuildServiceProvider(); 389var serviceProvider = serviceCollection.BuildServiceProvider(); 418serviceProvider = serviceCollection.BuildServiceProvider();
Rendering\DefaultTemplatesUtilities.cs (1)
275.BuildServiceProvider();
ViewComponentResultTest.cs (3)
416httpContext.RequestServices = services.BuildServiceProvider(); 458httpContext.RequestServices = services.BuildServiceProvider(); 692httpContext.RequestServices = services.BuildServiceProvider();
ViewComponents\ViewViewComponentResultTest.cs (1)
427var serviceProvider = new ServiceCollection().BuildServiceProvider();
ViewExecutorTest.cs (1)
167return serviceCollection.BuildServiceProvider();
ViewResultTest.cs (1)
260httpContext.RequestServices = services.BuildServiceProvider();
Microsoft.AspNetCore.OpenApi.Tests (15)
Extensions\OpenApiEndpointRouteBuilderExtensionsTests.cs (1)
190.BuildServiceProvider();
Extensions\OpenApiRouteHandlerBuilderExtensionTests.cs (7)
24.BuildServiceProvider(); 47.BuildServiceProvider(); 70.BuildServiceProvider(); 98.BuildServiceProvider(); 127.BuildServiceProvider(); 159.BuildServiceProvider(); 189.BuildServiceProvider();
Extensions\OpenApiServiceCollectionExtensionsTests.cs (6)
35var serviceProvider = services.BuildServiceProvider(); 69var serviceProvider = services.BuildServiceProvider(); 102var serviceProvider = services.BuildServiceProvider(); 135var serviceProvider = services.BuildServiceProvider(); 157var serviceProvider = services.BuildServiceProvider(); 181var serviceProvider = services.BuildServiceProvider();
Services\OpenApiDocumentServiceTestsBase.cs (1)
269_serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Owin.Tests (3)
OwinExtensionTests.cs (3)
41new ServiceCollection().AddSingleton(new FakeService()).BuildServiceProvider()); 58IServiceProvider expectedServiceProvider = new ServiceCollection().BuildServiceProvider(); 124var serviceProvider = new ServiceCollection().BuildServiceProvider();
Microsoft.AspNetCore.RateLimiting.Tests (6)
RateLimitingApplicationBuilderExtensionsTests.cs (4)
22var appBuilder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); 30var serviceProvider = services.BuildServiceProvider(); 54var serviceProvider = services.BuildServiceProvider(); 71var serviceProvider = services.BuildServiceProvider();
RateLimitingMetricsTests.cs (2)
184var serviceProvider = services.BuildServiceProvider(); 259var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.ResponseCompression.Microbenchmarks (1)
ResponseCompressionProviderBenchmark.cs (1)
21.BuildServiceProvider();
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
EndpointRoutingBenchmarkBase.cs (1)
37return services.BuildServiceProvider();
Microsoft.AspNetCore.Routing.Tests (57)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (1)
367var serviceProvder = services.BuildServiceProvider();
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (18)
263var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().AddSingleton<TodoService>().BuildServiceProvider())); 283var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().AddSingleton<TodoService>().BuildServiceProvider())); 303var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().AddSingleton<TodoService>().BuildServiceProvider())); 327var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().AddSingleton<TodoService>().BuildServiceProvider())); 347var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().AddSingleton<TodoService>().BuildServiceProvider())); 367var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().AddSingleton<TodoService>().BuildServiceProvider())); 638httpContext.RequestServices = new ServiceCollection().AddLogging().BuildServiceProvider(); 821httpContext.RequestServices = new ServiceCollection().AddLogging().BuildServiceProvider(); 839var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().BuildServiceProvider())); 848httpContext.RequestServices = new ServiceCollection().AddLogging().BuildServiceProvider(); 896httpContext.RequestServices = new ServiceCollection().BuildServiceProvider(); 917var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().BuildServiceProvider())); 933var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().BuildServiceProvider())); 961var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().BuildServiceProvider())); 974httpContext.RequestServices = serviceCollection.BuildServiceProvider(); 993var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(appServiceCollection.BuildServiceProvider())); 1016var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().BuildServiceProvider())); 1038var builder = new DefaultEndpointRouteBuilder(new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()));
Builder\RoutingBuilderExtensionsTest.cs (1)
130return services.BuildServiceProvider();
CompositeEndpointDataSourceTest.cs (6)
46var applicationServices = new ServiceCollection().BuildServiceProvider(); 74ApplicationServices = new ServiceCollection().BuildServiceProvider(), 289var applicationServices = new ServiceCollection().BuildServiceProvider(); 329var applicationServices = new ServiceCollection().BuildServiceProvider(); 381var applicationServices = new ServiceCollection().BuildServiceProvider(); 440var applicationServices = new ServiceCollection().BuildServiceProvider();
DefaultParameterPolicyFactoryTest.cs (1)
415services.BuildServiceProvider());
EndpointRoutingMiddlewareFormOptionsTest.cs (1)
100}).BuildServiceProvider();
EndpointRoutingMiddlewareTest.cs (1)
409var applicationBuilder = new ApplicationBuilder(services.BuildServiceProvider());
InlineRouteParameterParserTests.cs (1)
964var serviceProvider = services.BuildServiceProvider();
Internal\DfaGraphWriterTest.cs (1)
18return new DfaGraphWriter(services.BuildServiceProvider());
LinkGeneratorTestBase.cs (1)
70var serviceProvider = services.BuildServiceProvider();
LinkParserTestBase.cs (1)
62var serviceProvider = services.BuildServiceProvider();
Matching\DfaMatcherBuilderTest.cs (1)
3553serviceCollection.BuildServiceProvider());
Matching\DfaMatcherConformanceTest.cs (1)
68.BuildServiceProvider();
Matching\DfaMatcherTest.cs (1)
55var services = serviceCollection.BuildServiceProvider();
Matching\HostMatcherPolicyIntegrationTestBase.cs (1)
373.BuildServiceProvider();
Matching\HttpMethodMatcherPolicyIntegrationTestBase.cs (1)
352.BuildServiceProvider();
Matching\MatcherConformanceTest.cs (1)
28return services.BuildServiceProvider();
Patterns\DefaultRoutePatternTransformerTest.cs (1)
16Transformer = services.BuildServiceProvider().GetRequiredService<RoutePatternTransformer>();
RequestDelegateRouteBuilderExtensionsTest.cs (1)
129return services.BuildServiceProvider();
RouteBuilderTest.cs (1)
18var applicationServices = services.BuildServiceProvider();
RouteCollectionTest.cs (2)
609context.SetupGet(m => m.RequestServices).Returns(services.BuildServiceProvider()); 631RequestServices = services.BuildServiceProvider(),
RouteHandlerOptionsTests.cs (3)
27var serviceProvider = services.BuildServiceProvider(); 51var serviceProvider = services.BuildServiceProvider(); 63var serviceProvider = services.BuildServiceProvider();
RouteOptionsTests.cs (2)
21var serviceProvider = services.BuildServiceProvider(); 35var serviceProvider = services.BuildServiceProvider();
RouterMiddlewareTest.cs (1)
24RequestServices = services.BuildServiceProvider()
RouteTest.cs (3)
661RequestServices = services.BuildServiceProvider(), 1522RequestServices = services.BuildServiceProvider(), 1767applicationBuilder.ApplicationServices = services.BuildServiceProvider();
RoutingServiceCollectionExtensionsTests.cs (1)
76var provider = services.BuildServiceProvider();
TemplateParserDefaultValuesTests.cs (2)
137applicationBuilder.ApplicationServices = services.BuildServiceProvider(); 147var serviceProvider = services.BuildServiceProvider();
Tree\TreeRouteBuilderTest.cs (1)
258var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (7)
AddressBinderTests.cs (1)
297ApplicationServices = services.BuildServiceProvider()
KestrelServerOptionsTests.cs (2)
71ApplicationServices = new ServiceCollection().BuildServiceProvider() 88options.ApplicationServices = serviceCollection.BuildServiceProvider();
KestrelServerTests.cs (3)
42.BuildServiceProvider(); 797ApplicationServices = serviceCollection.BuildServiceProvider(), 935ApplicationServices = serviceCollection.BuildServiceProvider(),
ListenOptionsTests.cs (1)
26var serviceProvider = new ServiceCollection().BuildServiceProvider();
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
33.BuildServiceProvider();
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnectionBuilder.cs (1)
47var serviceProvider = Services.BuildServiceProvider();
Microsoft.AspNetCore.SignalR.Client.Tests (11)
HubConnectionBuilderExtensionsTests.cs (8)
25var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 38var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 52var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 68var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 83var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 94var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 106var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 119var serviceProvider = connectionBuilder.Services.BuildServiceProvider();
HubConnectionBuilderTests.cs (3)
39var serviceProvider = new HubConnectionBuilder().AddNewtonsoftJsonProtocol().Services.BuildServiceProvider(); 54}).Services.BuildServiceProvider(); 76var serviceProvider = new HubConnectionBuilder().AddMessagePackProtocol().Services.BuildServiceProvider();
Microsoft.AspNetCore.SignalR.Microbenchmarks (2)
DefaultHubActivatorBenchmark.cs (1)
19_activator = new DefaultHubActivator<MyHub>(services.BuildServiceProvider());
DefaultHubDispatcherBenchmark.cs (1)
28var provider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
RedisDependencyInjectionExtensionsTests.cs (1)
25var provider = services.BuildServiceProvider();
Microsoft.AspNetCore.SignalR.Tests (8)
AddSignalRTests.cs (7)
39var serviceProvider = serviceCollection.BuildServiceProvider(); 64var serviceProvider = serviceCollection.BuildServiceProvider(); 85var serviceProvider = serviceCollection.BuildServiceProvider(); 102var serviceProvider = serviceCollection.BuildServiceProvider(); 129var serviceProvider = serviceCollection.BuildServiceProvider(); 154var serviceProvider = serviceCollection.BuildServiceProvider(); 181var serviceProvider = serviceCollection.BuildServiceProvider();
HubConnectionHandlerTestUtils\Utils.cs (1)
72return services.BuildServiceProvider();
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
SpaServicesExtensionsTests.cs (1)
69return services.BuildServiceProvider();
Microsoft.AspNetCore.TestHost.Tests (6)
TestServerTests.cs (6)
159public IServiceProvider CreateServiceProvider(ThirdPartyContainer containerBuilder) => containerBuilder.Services.BuildServiceProvider(); 235Services = services.BuildServiceProvider(); 313var serviceProvider = new ServiceCollection().BuildServiceProvider(); 405httpContext.RequestServices = services.BuildServiceProvider(); 453.BuildServiceProvider(); 495var appServices = new ServiceCollection().BuildServiceProvider();
Microsoft.AspNetCore.Testing.Tests (1)
FakeStartupTests.cs (1)
20sut.Configure(new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()));
Microsoft.AspNetCore.Tests (7)
WebApplicationTests.cs (7)
1386var sp = builder.Services.BuildServiceProvider(); 1403var sp = builder.Services.BuildServiceProvider(); 1480var env1 = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider().GetRequiredService<IHostEnvironment>(); 1510var service1 = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider().GetRequiredService<IService>(); 1531using (var serviceProvider = builder.Services.BuildServiceProvider()) 1559var childServiceProvider = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider(); 3193public void Build() => _inner = _services.BuildServiceProvider();
Microsoft.AspNetCore.WebSockets.Tests (1)
AddWebSocketsTests.cs (1)
24var services = serviceCollection.BuildServiceProvider();
Microsoft.DotNet.Build.Tasks.Feed.Tests (13)
BuildModelFactoryTests.cs (1)
61.BuildServiceProvider();
GenerateBuildManifestTests.cs (2)
26var provider = collection.BuildServiceProvider(); 65using var provider = collection.BuildServiceProvider();
PublishArtifactsInManifestTests.cs (2)
51using var provider = collection.BuildServiceProvider(); 268var provider = collection.BuildServiceProvider();
PushToBuildStorageTests.cs (8)
218using var provider = collection.BuildServiceProvider(); 249using var provider = collection.BuildServiceProvider(); 297using var provider = collection.BuildServiceProvider(); 346using var provider = collection.BuildServiceProvider(); 393using var provider = collection.BuildServiceProvider(); 443using var provider = collection.BuildServiceProvider(); 548using var provider = collection.BuildServiceProvider(); 563var provider = collection.BuildServiceProvider();
Microsoft.DotNet.Helix.Sdk.Tests (24)
CreateXHarnessAndroidWorkItemsTests.cs (6)
53using var provider = collection.BuildServiceProvider(); 71using var provider = collection.BuildServiceProvider(); 110using var provider = collection.BuildServiceProvider(); 140using var provider = collection.BuildServiceProvider(); 173using var provider = collection.BuildServiceProvider(); 205var provider = collection.BuildServiceProvider();
CreateXHarnessAppleWorkItemsTests.cs (7)
55using var provider = collection.BuildServiceProvider(); 74using var provider = collection.BuildServiceProvider(); 120using var provider = collection.BuildServiceProvider(); 152using var provider = collection.BuildServiceProvider(); 181using var provider = collection.BuildServiceProvider(); 225using var provider = collection.BuildServiceProvider(); 264var provider = collection.BuildServiceProvider();
FindDotNetCliPackageTests.cs (4)
62using var provider = collection.BuildServiceProvider(); 109using var provider = collection.BuildServiceProvider(); 160using var provider = collection.BuildServiceProvider(); 214using var provider = collection.BuildServiceProvider();
InstallDotNetToolTests.cs (7)
90using var provider = collection.BuildServiceProvider(); 120using var provider = collection.BuildServiceProvider(); 145using var provider = collection.BuildServiceProvider(); 190using var provider = collection.BuildServiceProvider(); 269using var provider1 = collection1.BuildServiceProvider(); 270using var provider2 = collection2.BuildServiceProvider(); 323var provider = collection.BuildServiceProvider();
Microsoft.DotNet.VersionTools.Tasks.Tests (2)
LocalUpdatePublishedVersionsTests.cs (1)
21var provider = collection.BuildServiceProvider();
UpdatePublishedVersionsTests.cs (1)
21var provider = collection.BuildServiceProvider();
Microsoft.Extensions.AI.Tests (11)
ChatCompletion\ChatClientBuilderTest.cs (1)
15var expectedServiceProvider = new ServiceCollection().BuildServiceProvider();
ChatCompletion\DependencyInjectionPatterns.cs (4)
22var services = ServiceCollection.BuildServiceProvider(); 46var services = ServiceCollection.BuildServiceProvider(); 69var services = ServiceCollection.BuildServiceProvider(); 95var services = ServiceCollection.BuildServiceProvider();
ChatCompletion\DistributedCachingChatClientTest.cs (1)
675.BuildServiceProvider();
ChatCompletion\FunctionInvokingChatClientTests.cs (1)
421await work(c.BuildServiceProvider());
ChatCompletion\LoggingChatClientTests.cs (1)
34var services = c.BuildServiceProvider();
Embeddings\DistributedCachingEmbeddingGeneratorTest.cs (1)
316.BuildServiceProvider();
Embeddings\EmbeddingGeneratorBuilderTests.cs (1)
15var expectedServiceProvider = new ServiceCollection().BuildServiceProvider();
Embeddings\LoggingEmbeddingGeneratorTests.cs (1)
33var services = c.BuildServiceProvider();
Microsoft.Extensions.AmbientMetadata.Application.Tests (2)
ApplicationMetadataExtensionsTests.cs (2)
112.BuildServiceProvider(); 138.BuildServiceProvider();
Microsoft.Extensions.AsyncState.Tests (1)
AsyncStateTests.cs (1)
257var services = new ServiceCollection().AddAsyncState().BuildServiceProvider();
Microsoft.Extensions.Caching.Hybrid.Tests (29)
BufferReleaseTests.cs (1)
22ServiceProvider provider = services.BuildServiceProvider();
DistributedCacheTests.cs (4)
60var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>(); 106var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>(); 172var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>() as IBufferDistributedCache; 234var cache = (await InitAsync()).BuildServiceProvider().GetService<IDistributedCache>() as IBufferDistributedCache;
FunctionalTests.cs (1)
16ServiceProvider provider = services.BuildServiceProvider();
L2Tests.cs (1)
41ServiceProvider provider = services.BuildServiceProvider();
RedisTests.cs (1)
48ServiceProvider provider = services.BuildServiceProvider(); // not "using" - that will tear down our redis; use the fixture for that
SampleUsage.cs (4)
19using ServiceProvider provider = services.BuildServiceProvider(); 39using ServiceProvider provider = services.BuildServiceProvider(); 59using ServiceProvider provider = services.BuildServiceProvider(); 79using ServiceProvider provider = services.BuildServiceProvider();
ServiceConstructionTests.cs (10)
30using ServiceProvider provider = services.BuildServiceProvider(); 43using ServiceProvider provider = services.BuildServiceProvider(); 91using ServiceProvider provider = services.BuildServiceProvider(); 104using ServiceProvider provider = services.BuildServiceProvider(); 117using ServiceProvider provider = services.BuildServiceProvider(); 131using ServiceProvider provider = services.BuildServiceProvider(); 143using ServiceProvider provider = services.BuildServiceProvider(); 166using ServiceProvider provider = services.BuildServiceProvider(); 178using ServiceProvider provider = services.BuildServiceProvider(); 201using ServiceProvider provider = services.BuildServiceProvider();
SizeTests.cs (4)
51using ServiceProvider provider = services.BuildServiceProvider(); 120using ServiceProvider provider = services.BuildServiceProvider(); 164using ServiceProvider provider = services.BuildServiceProvider(); 230using ServiceProvider provider = services.BuildServiceProvider();
StampedeTests.cs (1)
27ServiceProvider provider = services.BuildServiceProvider();
UnreliableL2Tests.cs (2)
128var backend = services.BuildServiceProvider().GetRequiredService<IDistributedCache>(); 142var lifetime = services.BuildServiceProvider();
Microsoft.Extensions.Caching.MicroBenchmarks (2)
DistributedCacheBenchmarks.cs (2)
58sqlServer = (IBufferDistributedCache)services.BuildServiceProvider().GetRequiredService<IDistributedCache>(); 66redis = (IBufferDistributedCache)services.BuildServiceProvider().GetRequiredService<IDistributedCache>();
Microsoft.Extensions.Caching.SqlServer.Tests (1)
SqlServerCacheServicesExtensionsTest.cs (1)
46var serviceProvider = services.BuildServiceProvider();
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (4)
CacheServiceExtensionsTests.cs (4)
43var serviceProvider = services.BuildServiceProvider(); 70using var serviceProvider = services.BuildServiceProvider(); 87using var serviceProvider = services.BuildServiceProvider(); 114var serviceProvider = services.BuildServiceProvider();
Microsoft.Extensions.Compliance.Redaction.Tests (8)
HmacRedactorExtensionsTests.cs (2)
18.BuildServiceProvider(); 35.BuildServiceProvider();
HmacRedactorTest.cs (2)
104.BuildServiceProvider() 129.BuildServiceProvider()
RedactionAcceptanceTests.cs (3)
26.BuildServiceProvider(); 46.BuildServiceProvider(); 66.BuildServiceProvider();
RedactorProviderTests.cs (1)
90.BuildServiceProvider()
Microsoft.Extensions.Compliance.Testing.Tests (12)
RedactionFakesAcceptanceTests.cs (11)
23.BuildServiceProvider(); 42.BuildServiceProvider(); 62.BuildServiceProvider(); 81.BuildServiceProvider(); 101.BuildServiceProvider(); 121.BuildServiceProvider(); 141.BuildServiceProvider(); 161.BuildServiceProvider(); 181.BuildServiceProvider(); 202.BuildServiceProvider(); 245using var sp = new ServiceCollection().AddFakeRedaction().BuildServiceProvider();
RedactionFakesEventCollectorTests.cs (1)
25using var sp = new ServiceCollection().BuildServiceProvider();
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (5)
ApplicationLifecycleHealthChecksExtensionsTests.cs (1)
55using var serviceProvider = serviceCollection.BuildServiceProvider();
ManualHealthCheckExtensionsTests.cs (1)
50using var serviceProvider = serviceCollection.BuildServiceProvider();
TelemetryHealthChecksPublisherExtensionsTests.cs (3)
24using var serviceProvider = serviceCollection.BuildServiceProvider(); 44using var serviceProvider = serviceCollection.BuildServiceProvider(); 62using var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (11)
DefaultHealthCheckServiceTest.cs (1)
40var services = serviceCollection.BuildServiceProvider();
DependencyInjection\HealthChecksBuilderTest.cs (9)
29var serviceProvider = services.BuildServiceProvider(); 49var serviceProvider = services.BuildServiceProvider(); 72var serviceProvider = services.BuildServiceProvider(); 94var serviceProvider = services.BuildServiceProvider(); 120var serviceProvider = services.BuildServiceProvider(); 143var serviceProvider = services.BuildServiceProvider(); 166var serviceProvider = services.BuildServiceProvider(); 189var serviceProvider = services.BuildServiceProvider(); 214var options = services.BuildServiceProvider().GetRequiredService<IOptions<HealthCheckServiceOptions>>();
HealthCheckPublisherHostedServiceTest.cs (1)
784var services = serviceCollection.BuildServiceProvider();
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (10)
Linux\AcceptanceTest.cs (5)
32.BuildServiceProvider(); 61.BuildServiceProvider(); 83.BuildServiceProvider(); 128.BuildServiceProvider(); 176.BuildServiceProvider();
ResourceMonitoringBuilderTests.cs (2)
22.BuildServiceProvider(); 45.BuildServiceProvider();
ResourceMonitoringExtensionsTests.cs (3)
42.BuildServiceProvider(); 58.BuildServiceProvider(); 78.BuildServiceProvider();
Microsoft.Extensions.Diagnostics.Testing.Tests (4)
Logging\FakeLoggerExtensionsTests.cs (4)
20.BuildServiceProvider(); 36.BuildServiceProvider(); 64.BuildServiceProvider(); 83.BuildServiceProvider();
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (8)
HttpClientFactory.cs (8)
33.BuildServiceProvider() 56.BuildServiceProvider() 83.BuildServiceProvider() 106.BuildServiceProvider() 129.BuildServiceProvider() 156.BuildServiceProvider() 167.BuildServiceProvider() 177.BuildServiceProvider()
Microsoft.Extensions.Http.Diagnostics.Tests (33)
Latency\HttpClientLatencyTelemetryExtensionsTest.cs (4)
40.BuildServiceProvider(); 64.BuildServiceProvider(); 81.BuildServiceProvider(); 101.BuildServiceProvider();
Logging\AcceptanceTests.cs (15)
37.BuildServiceProvider(); 68.BuildServiceProvider(); 104.BuildServiceProvider(); 157.BuildServiceProvider(); 238.BuildServiceProvider(); 305.BuildServiceProvider(); 352.BuildServiceProvider(); 417.BuildServiceProvider(); 463.BuildServiceProvider(); 499.BuildServiceProvider(); 554.BuildServiceProvider(); 588.BuildServiceProvider(); 612.BuildServiceProvider(); 637.BuildServiceProvider(); 675.BuildServiceProvider();
Logging\HttpClientLoggingExtensionsTest.cs (12)
91.BuildServiceProvider(); 114.BuildServiceProvider(); 137.BuildServiceProvider(); 177using var provider = services.BuildServiceProvider(); 233.BuildServiceProvider(); 246.BuildServiceProvider(); 287using var provider = services.BuildServiceProvider(); 322.BuildServiceProvider(); 349.BuildServiceProvider(); 364.Services.BuildServiceProvider(); 383.BuildServiceProvider(); 401.BuildServiceProvider();
Logging\Internal\TestHttpMessageHandlerBuilder.cs (1)
28public override IServiceProvider Services => _services.BuildServiceProvider();
Telemetry\DownstreamDependencyMetadataManagerTests.cs (1)
22.BuildServiceProvider();
Microsoft.Extensions.Http.Polly (1)
DependencyInjection\PollyServiceCollectionExtensions.cs (1)
32var registry = services.BuildServiceProvider().GetService<IPolicyRegistry<string>>();
Microsoft.Extensions.Http.Polly.Tests (13)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (13)
51var services = serviceCollection.BuildServiceProvider(); 86var services = serviceCollection.BuildServiceProvider(); 124var services = serviceCollection.BuildServiceProvider(); 165var services = serviceCollection.BuildServiceProvider(); 209var services = serviceCollection.BuildServiceProvider(); 262var services = serviceCollection.BuildServiceProvider(); 307var services = serviceCollection.BuildServiceProvider(); 351var services = serviceCollection.BuildServiceProvider(); 421var services = serviceCollection.BuildServiceProvider(); 451var services = serviceCollection.BuildServiceProvider(); 469var services = serviceCollection.BuildServiceProvider(); 488var services = serviceCollection.BuildServiceProvider(); 508var services = serviceCollection.BuildServiceProvider();
Microsoft.Extensions.Http.Resilience.PerformanceTests (3)
HttpClientFactory.cs (1)
62return services.BuildServiceProvider();
RetryBenchmark.cs (1)
62var factory = services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>();
StandardResilienceBenchmark.cs (1)
64var factory = services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>();
Microsoft.Extensions.Http.Resilience.Tests (21)
Hedging\HedgingTests.cs (1)
344_serviceProvider = _services.BuildServiceProvider();
Hedging\StandardHedgingTests.cs (6)
65using var serviceProvider = Builder.Services.BuildServiceProvider(); 80using var serviceProvider = Builder.Services.BuildServiceProvider(); 102using var serviceProvider = Builder.Services.BuildServiceProvider(); 111using var serviceProvider = Builder.Services.BuildServiceProvider(); 173using var serviceProvider = Builder.Services.BuildServiceProvider(); 335await using var provider = services.BuildServiceProvider();
Resilience\HttpClientBuilderExtensionsTests.BySelector.cs (3)
36var provider = _builder.Services.BuildServiceProvider().GetPipelineKeyProvider(pipelineName)!; 51var provider = PipelineKeyProviderHelper.GetPipelineKeyProvider(builder.Services.BuildServiceProvider(), builder.PipelineName)!; 82var provider = _builder.Services.BuildServiceProvider().GetPipelineKeyProvider(pipelineName)!;
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (6)
77using (var serviceProvider = services.BuildServiceProvider()) 132var client = clientBuilder.Services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>().CreateClient("client"); 173using var serviceProvider = builder.Services.BuildServiceProvider(); 215using var provider = services.BuildServiceProvider(); 263using var provider = services.BuildServiceProvider(); 283using var serviceProvider = clientBuilder.Services.BuildServiceProvider();
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (4)
59_serviceProvider ??= _builder.Services.BuildServiceProvider(); 161.Services.BuildServiceProvider(); 266using var client = builder.Services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>().CreateClient("test"); 297var provider = services.BuildServiceProvider().GetRequiredService<ResiliencePipelineProvider<HttpKey>>();
Routing\RoutingStrategyTest.cs (1)
153.BuildServiceProvider()
Microsoft.Extensions.Logging (1)
LoggerFactory.cs (1)
115ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.Extensions.ML.Tests (7)
FileLoaderTests.cs (3)
32var sp = services.BuildServiceProvider(); 45var sp = services.BuildServiceProvider(); 64var sp = services.BuildServiceProvider();
PredictionEnginePoolTests.cs (1)
36var sp = services.BuildServiceProvider();
UriLoaderTests.cs (3)
32var sp = services.BuildServiceProvider(); 45var sp = services.BuildServiceProvider(); 64var sp = services.BuildServiceProvider();
Microsoft.Extensions.ObjectPool.DependencyInjection.Tests (3)
DependencyInjectionExtensionsTests.cs (3)
52using var provider = services.BuildServiceProvider(); 117var pool = services.BuildServiceProvider().GetService<ObjectPool<TestDependency>>(); 118using var provider = services.BuildServiceProvider();
Microsoft.Extensions.Options.Contextual.Tests (5)
ContextualOptionsServiceCollectionExtensionsTests.cs (5)
22using var provider = new ServiceCollection().AddContextualOptions().BuildServiceProvider(); 35using var provider = new ServiceCollection().Configure(loadOptions).BuildServiceProvider(); 45using var provider = new ServiceCollection().Configure(configureOptions).BuildServiceProvider(); 57using var provider = new ServiceCollection().ConfigureAll(loadOptions).BuildServiceProvider(); 67using var provider = new ServiceCollection().ConfigureAll(configureOptions).BuildServiceProvider();
Microsoft.Extensions.Resilience.PerformanceTests (1)
ResilienceEnrichmentBenchmark.cs (1)
47return services.BuildServiceProvider().GetRequiredService<ResiliencePipelineProvider<string>>().GetPipeline("my-pipeline");
Microsoft.Extensions.Resilience.Tests (2)
Resilience\ResilienceServiceCollectionExtensionsTests.cs (2)
38var enrichers = _services.BuildServiceProvider().GetRequiredService<IOptions<TelemetryOptions>>().Value.MeteringEnrichers; 48var enrichers = services.BuildServiceProvider().GetRequiredService<IOptions<TelemetryOptions>>().Value.MeteringEnrichers;
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
DnsServiceEndpointResolverTests.cs (1)
21.BuildServiceProvider();
DnsSrvServiceEndpointResolverTests.cs (2)
106.BuildServiceProvider(); 193var services = serviceCollection.BuildServiceProvider();
Microsoft.Extensions.ServiceDiscovery.Tests (19)
ConfigurationServiceEndpointResolverTests.cs (7)
31.BuildServiceProvider(); 72.BuildServiceProvider(); 156.BuildServiceProvider(); 248.BuildServiceProvider(); 290.BuildServiceProvider(); 357.BuildServiceProvider(); 402.BuildServiceProvider();
PassThroughServiceEndpointResolverTests.cs (4)
26.BuildServiceProvider(); 57.BuildServiceProvider(); 90.BuildServiceProvider(); 124.BuildServiceProvider();
ServiceEndpointResolverTests.cs (8)
27.BuildServiceProvider(); 38.BuildServiceProvider(); 51.BuildServiceProvider(); 61var services = serviceCollection.BuildServiceProvider(); 105.BuildServiceProvider(); 157.BuildServiceProvider(); 193.BuildServiceProvider(); 238.BuildServiceProvider();
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (7)
YarpServiceDiscoveryTests.cs (7)
35.BuildServiceProvider(); 66.BuildServiceProvider(); 96.BuildServiceProvider(); 130.BuildServiceProvider(); 215.BuildServiceProvider(); 238.BuildServiceProvider(); 297.BuildServiceProvider();
Microsoft.Extensions.Telemetry.Abstractions.Tests (5)
Enrichment\EnricherExtensionsTests.cs (2)
40using var provider = services.BuildServiceProvider(); 59using var provider = services.BuildServiceProvider();
Latency\LatencyRegistryExtensionsTests.cs (1)
42var serviceProvider = services.BuildServiceProvider();
Latency\NoopLatencyContextTests.cs (2)
24.BuildServiceProvider(); 36.BuildServiceProvider();
Microsoft.Extensions.Telemetry.PerformanceTests (1)
ExtendedLoggerBench.cs (1)
76return serviceCollection.BuildServiceProvider().GetRequiredService<ILoggerFactory>().CreateLogger("Benchmark");
Microsoft.Extensions.Telemetry.Tests (17)
Http\HttpParserTests.cs (1)
644var sp = new ServiceCollection().AddHttpRouteProcessor().AddFakeRedaction().BuildServiceProvider();
Latency\Internal\LatencyContextTests.cs (8)
79.BuildServiceProvider() 106.BuildServiceProvider() 132.BuildServiceProvider() 160.BuildServiceProvider() 190.BuildServiceProvider() 216.BuildServiceProvider() 241.BuildServiceProvider() 267.BuildServiceProvider()
Latency\LatencyConsoleExtensionsTests.cs (3)
30.BuildServiceProvider(); 43.BuildServiceProvider(); 61.BuildServiceProvider();
Latency\LatencyContextExtensionTests.cs (4)
29.BuildServiceProvider(); 45.BuildServiceProvider(); 72.BuildServiceProvider(); 97.BuildServiceProvider();
Logging\Utils.cs (1)
22ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.Extensions.WebEncoders.Tests (3)
EncoderServiceCollectionExtensionsTests.cs (3)
23var serviceProvider = serviceCollection.BuildServiceProvider(); 46var serviceProvider = serviceCollection.BuildServiceProvider(); 78var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.Gen.Logging.Generated.Tests (1)
Utils.cs (1)
90var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.ML.AutoML (1)
AutoMLExperiment\AutoMLExperiment.cs (1)
229var serviceProvider = _serviceCollection.BuildServiceProvider();
PhotinoTestApp (1)
Program.cs (1)
23services: serviceCollection.BuildServiceProvider(),
Redis (1)
Program.cs (1)
24.BuildServiceProvider())
Sockets.BindTests (1)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
138return services.BuildServiceProvider();
Sockets.FunctionalTests (1)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
138return services.BuildServiceProvider();
Wasm.Performance.ConsoleHost (1)
Scenarios\ComponentRenderingScenarioBase.cs (1)
28var serviceProvider = serviceCollection.BuildServiceProvider();