16 implementations of ServiceProvider
Microsoft.AspNetCore (1)
WebApplication.cs (1)
88IServiceProvider IEndpointRouteBuilder.ServiceProvider => Services;
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (1)
270public IServiceProvider ServiceProvider { get; } = CreateServiceProvider();
HotReloadServiceTests.cs (1)
298public IServiceProvider ServiceProvider => _serviceProvider;
RazorComponentEndpointDataSourceTest.cs (1)
322public IServiceProvider ServiceProvider => _serviceProvider;
Microsoft.AspNetCore.Components.Server (1)
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (1)
132public IServiceProvider ServiceProvider { get; }
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
JsonTranscodingServiceMethodProviderTests.cs (1)
247public IServiceProvider ServiceProvider { get; }
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
MapPathMiddlewareTests.cs (1)
256public IServiceProvider ServiceProvider => throw new NotImplementedException();
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
483public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
483public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1629public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Builder\PageActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
211public IServiceProvider ServiceProvider { get; } = CreateServiceProvider();
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
Builder\ControllerActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
284public IServiceProvider ServiceProvider { get; } = CreateServiceProvider();
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentServiceTestsBase.cs (1)
181public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;
Microsoft.AspNetCore.Routing (2)
DefaultEndpointRouteBuilder.cs (1)
22public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;
RouteGroupBuilder.cs (1)
34IServiceProvider IEndpointRouteBuilder.ServiceProvider => _outerEndpointRouteBuilder.ServiceProvider;
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
EndpointRoutingShortCircuitBenchmark.cs (1)
100public IServiceProvider ServiceProvider => throw new NotImplementedException();
64 references to ServiceProvider
IntegrationTestsWebsite (1)
Startup.cs (1)
35endpoints.DataSources.Add(endpoints.ServiceProvider.GetRequiredService<DynamicEndpointDataSource>());
Microsoft.AspNetCore.Components.Endpoints (2)
Builder\RazorComponentsEndpointRouteBuilderExtensions.cs (2)
48var factory = endpoints.ServiceProvider.GetRequiredService<RazorComponentEndpointDataSourceFactory>(); 59var marker = endpoints.ServiceProvider.GetService<RazorComponentsMarkerService>();
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Builder\WebAssemblyRazorComponentsEndpointConventionBuilderExtensions.cs (2)
55var environment = endpointBuilder.ServiceProvider.GetRequiredService<IWebHostEnvironment>(); 68var logger = endpointBuilder.ServiceProvider.GetRequiredService<ILogger<WebAssemblyComponentsEndpointOptions>>();
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
Builder\HealthCheckEndpointRouteBuilderExtensions.cs (1)
57if (endpoints.ServiceProvider.GetService(typeof(HealthCheckService)) == null)
Microsoft.AspNetCore.Http.Connections (2)
ConnectionEndpointRouteBuilderExtensions.cs (2)
85var dispatcher = endpoints.ServiceProvider.GetRequiredService<HttpConnectionDispatcher>(); 87var connectionBuilder = new ConnectionBuilder(endpoints.ServiceProvider);
Microsoft.AspNetCore.Identity (4)
IdentityApiEndpointRouteBuilderExtensions.cs (4)
45var timeProvider = endpoints.ServiceProvider.GetRequiredService<TimeProvider>(); 46var bearerTokenOptions = endpoints.ServiceProvider.GetRequiredService<IOptionsMonitor<BearerTokenOptions>>(); 47var emailSender = endpoints.ServiceProvider.GetRequiredService<IEmailSender<TUser>>(); 48var linkGenerator = endpoints.ServiceProvider.GetRequiredService<LinkGenerator>();
Microsoft.AspNetCore.Mvc.Core (9)
Builder\ControllerEndpointRouteBuilderExtensions.cs (9)
208RegisterInCache(endpoints.ServiceProvider, dataSource); 272RegisterInCache(endpoints.ServiceProvider, dataSource); 332RegisterInCache(endpoints.ServiceProvider, dataSource); 398RegisterInCache(endpoints.ServiceProvider, dataSource); 465RegisterInCache(endpoints.ServiceProvider, controllerDataSource); 500RegisterInCache(endpoints.ServiceProvider, controllerDataSource); 518var marker = endpoints.ServiceProvider.GetService<MvcMarkerService>(); 533var orderProvider = endpoints.ServiceProvider.GetRequiredService<OrderedEndpointsSequenceProviderCache>(); 534var factory = endpoints.ServiceProvider.GetRequiredService<ControllerActionEndpointDataSourceFactory>();
Microsoft.AspNetCore.Mvc.RazorPages (9)
Builder\RazorPagesEndpointRouteBuilderExtensions.cs (9)
77RegisterInCache(endpoints.ServiceProvider, pageDataSource); 135RegisterInCache(endpoints.ServiceProvider, pageDataSource); 189RegisterInCache(endpoints.ServiceProvider, pageDataSource); 249RegisterInCache(endpoints.ServiceProvider, pageDataSource); 314RegisterInCache(endpoints.ServiceProvider, pageDataSource); 348RegisterInCache(endpoints.ServiceProvider, pageDataSource); 364var marker = endpoints.ServiceProvider.GetService<PageActionEndpointDataSourceFactory>(); 379var orderProviderCache = endpoints.ServiceProvider.GetRequiredService<OrderedEndpointsSequenceProviderCache>(); 380var factory = endpoints.ServiceProvider.GetRequiredService<PageActionEndpointDataSourceFactory>();
Microsoft.AspNetCore.OpenApi (1)
Extensions\OpenApiEndpointRouteBuilderExtensions.cs (1)
30var options = endpoints.ServiceProvider.GetRequiredService<IOptionsMonitor<OpenApiOptions>>();
Microsoft.AspNetCore.OpenApi.Microbenchmarks (7)
GenerationBenchmarks.cs (1)
39_serviceProvider = _builder.ServiceProvider.CreateScope().ServiceProvider;
TransformersBenchmark.cs (6)
38_serviceProvider = _builder.ServiceProvider.CreateScope().ServiceProvider; 54_serviceProvider = _builder.ServiceProvider.CreateScope().ServiceProvider; 66_serviceProvider = _builder.ServiceProvider.CreateScope().ServiceProvider; 82_serviceProvider = _builder.ServiceProvider.CreateScope().ServiceProvider; 94_serviceProvider = _builder.ServiceProvider.CreateScope().ServiceProvider; 117_serviceProvider = _builder.ServiceProvider.CreateScope().ServiceProvider;
Microsoft.AspNetCore.OpenApi.Tests (10)
Services\OpenApiDocumentServiceTestsBase.cs (10)
37var scopedService = ((TestServiceProvider)builder.ServiceProvider).CreateScope(); 88var schemaService = new OpenApiSchemaService("Test", Options.Create(new Microsoft.AspNetCore.Http.Json.JsonOptions()), builder.ServiceProvider, openApiOptions.Object); 89((TestServiceProvider)builder.ServiceProvider).TestSchemaService = schemaService; 90var documentService = new OpenApiDocumentService("Test", apiDescriptionGroupCollectionProvider, hostEnvironment, openApiOptions.Object, builder.ServiceProvider, new OpenApiTestServer()); 91((TestServiceProvider)builder.ServiceProvider).TestDocumentService = documentService; 129var jsonOptions = builder.ServiceProvider.GetService<IOptions<Microsoft.AspNetCore.Http.Json.JsonOptions>>() ?? Options.Create(new Microsoft.AspNetCore.Http.Json.JsonOptions()); 131var schemaService = new OpenApiSchemaService("Test", jsonOptions, builder.ServiceProvider, options.Object); 132((TestServiceProvider)builder.ServiceProvider).TestSchemaService = schemaService; 133var documentService = new OpenApiDocumentService("Test", apiDescriptionGroupCollectionProvider, hostEnvironment, options.Object, builder.ServiceProvider, new OpenApiTestServer()); 134((TestServiceProvider)builder.ServiceProvider).TestDocumentService = documentService;
Microsoft.AspNetCore.Routing (4)
Builder\EndpointRouteBuilderExtensions.cs (2)
458var routeHandlerOptions = endpoints.ServiceProvider?.GetService<IOptions<RouteHandlerOptions>>(); 461routeEndpointDataSource = new RouteEndpointDataSource(endpoints.ServiceProvider ?? EmptyServiceProvider.Instance, throwOnBadRequest);
RouteGroupBuilder.cs (2)
34IServiceProvider IEndpointRouteBuilder.ServiceProvider => _outerEndpointRouteBuilder.ServiceProvider; 52Array.Empty<Action<EndpointBuilder>>(), _routeGroupBuilder._outerEndpointRouteBuilder.ServiceProvider);
Microsoft.AspNetCore.SignalR (1)
HubEndpointRouteBuilderExtensions.cs (1)
41var marker = endpoints.ServiceProvider.GetService<SignalRMarkerService>();
Microsoft.AspNetCore.StaticAssets (10)
Development\StaticAssetDevelopmentRuntimeHandler.cs (2)
171var config = endpoints.ServiceProvider.GetRequiredService<IConfiguration>(); 193var logger = endpoints.ServiceProvider.GetRequiredService<ILogger<StaticAssetDevelopmentRuntimeHandler>>();
Infrastructure\StaticAssetsEndpointDataSourceHelper.cs (2)
20staticAssetsManifestPath = ApplyStaticAssetManifestPathConventions(staticAssetsManifestPath, builder.ServiceProvider); 42manifestPath = ApplyStaticAssetManifestPathConventions(manifestPath, endpointRouteBuilder.ServiceProvider);
StaticAssetsEndpointRouteBuilderExtensions.cs (4)
30var environment = endpoints.ServiceProvider.GetRequiredService<IWebHostEnvironment>(); 39if (StaticAssetDevelopmentRuntimeHandler.IsEnabled(result.IsBuildManifest, endpoints.ServiceProvider)) 91var environment = endpoints.ServiceProvider.GetRequiredService<IWebHostEnvironment>(); 94if (StaticAssetDevelopmentRuntimeHandler.IsEnabled(result.IsBuildManifest, endpoints.ServiceProvider))
StaticAssetsManifest.cs (2)
41endpoints.ServiceProvider, 42new StaticAssetEndpointFactory(endpoints.ServiceProvider),
RoutingSandbox (1)
Framework\FrameworkEndpointRouteBuilderExtensions.cs (1)
13var dataSource = endpoints.ServiceProvider.GetRequiredService<FrameworkEndpointDataSource>();