7 interfaces inheriting from IServiceProvider
Microsoft.Extensions.DependencyInjection.Abstractions (1)
Microsoft.Maui (2)
System.ComponentModel.Primitives (1)
System.ComponentModel.TypeConverter (3)
79 implementations of IServiceProvider
Aspire.Hosting (1)
Aspire.Hosting.Tests (1)
Microsoft.AspNetCore.Components.Authorization.Tests (1)
Microsoft.AspNetCore.Components.Forms.Tests (1)
Microsoft.AspNetCore.Components.Performance (1)
Microsoft.AspNetCore.Components.Tests (1)
Microsoft.AspNetCore.Components.Web.Tests (1)
Microsoft.AspNetCore.Diagnostics.Tests (1)
Microsoft.AspNetCore.Hosting (1)
Microsoft.AspNetCore.Hosting.Tests (2)
Microsoft.AspNetCore.Http.Abstractions (2)
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
Microsoft.AspNetCore.Http.Connections (1)
Microsoft.AspNetCore.Http.Extensions (1)
Microsoft.AspNetCore.Http.Extensions.Tests (3)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.Http.Results.Tests (2)
Microsoft.AspNetCore.Http.Tests (1)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
Microsoft.AspNetCore.Mvc.Core.Test (1)
Microsoft.AspNetCore.OpenApi.Tests (1)
Microsoft.AspNetCore.Owin (1)
Microsoft.AspNetCore.Routing (2)
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
Microsoft.AspNetCore.Routing.Tests (7)
Microsoft.AspNetCore.Tests (1)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.Extensions.DependencyInjection (2)
Microsoft.Maui (1)
Microsoft.Maui.Controls (1)
Microsoft.Maui.Controls.Xaml (1)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
MockHostTypes (1)
PresentationFramework (16)
ReachFramework (1)
System.ComponentModel.Annotations (1)
System.ComponentModel.TypeConverter (2)
System.Windows.Forms (2)
System.Windows.Forms.Design (5)
System.Xaml (1)
System.Xaml.Tests (4)
2872 references to IServiceProvider
aspire (4)
Aspire.Azure.AI.Inference (1)
Aspire.Azure.Messaging.EventHubs (1)
Aspire.Cli.Tests (31)
Utils\CliTestHelper.cs (22)
60public Func<IServiceProvider, IAnsiConsole> AnsiConsoleFactory { get; set; } = (IServiceProvider serviceProvider) =>
73public Func<IServiceProvider, INewCommandPrompter> NewCommandPrompterFactory { get; set; } = (IServiceProvider serviceProvider) =>
79public Func<IServiceProvider, IAddCommandPrompter> AddCommandPrompterFactory { get; set; } = (IServiceProvider serviceProvider) =>
85public Func<IServiceProvider, IPublishCommandPrompter> PublishCommandPrompterFactory { get; set; } = (IServiceProvider serviceProvider) =>
91public Func<IServiceProvider, IProjectLocator> ProjectLocatorFactory { get; set; } = (IServiceProvider serviceProvider) => {
98public Func<IServiceProvider, IInteractionService> InteractionServiceFactory { get; set; } = (IServiceProvider serviceProvider) => {
103public Func<IServiceProvider, ICertificateService> CertificateServiceFactory { get; set; } = (IServiceProvider serviceProvider) => {
108public Func<IServiceProvider, IDotNetCliRunner> DotNetCliRunnerFactory { get; set; } = (IServiceProvider serviceProvider) => {
113public Func<IServiceProvider, INuGetPackageCache> NuGetPackageCacheFactory { get; set; } = (IServiceProvider serviceProvider) => {
120public Func<IServiceProvider, IAppHostBackchannel> AppHostBackchannelFactory { get; set; } = (IServiceProvider serviceProvider) =>
127public Func<IServiceProvider, ITemplateProvider> TemplateProviderFactory { get; set; } = (IServiceProvider serviceProvider) =>
Aspire.Components.Common.Tests (1)
Aspire.Confluent.Kafka (38)
AspireKafkaConsumerExtensions.cs (19)
25/// <inheritdoc cref="AddKafkaConsumer{TKey,TValue}(IHostApplicationBuilder, string, Action{KafkaConsumerSettings}?, Action{IServiceProvider,ConsumerBuilder{TKey,TValue}}?)"/>
29/// <inheritdoc cref="AddKafkaConsumer{TKey,TValue}(IHostApplicationBuilder, string, Action{KafkaConsumerSettings}?, Action{IServiceProvider,ConsumerBuilder{TKey,TValue}}?)"/>
33/// <inheritdoc cref="AddKafkaConsumer{TKey,TValue}(IHostApplicationBuilder, string, Action{KafkaConsumerSettings}?, Action{IServiceProvider,ConsumerBuilder{TKey,TValue}}?)"/>
37/// <inheritdoc cref="AddKafkaConsumer{TKey,TValue}(IHostApplicationBuilder, string, Action{KafkaConsumerSettings}?, Action{IServiceProvider,ConsumerBuilder{TKey,TValue}}?)"/>
38public static void AddKafkaConsumer<TKey, TValue>(this IHostApplicationBuilder builder, string connectionName, Action<IServiceProvider, ConsumerBuilder<TKey, TValue>>? configureBuilder)
41/// <inheritdoc cref="AddKafkaConsumer{TKey,TValue}(IHostApplicationBuilder, string, Action{KafkaConsumerSettings}?, Action{IServiceProvider,ConsumerBuilder{TKey,TValue}}?)"/>
53public static void AddKafkaConsumer<TKey, TValue>(this IHostApplicationBuilder builder, string connectionName, Action<KafkaConsumerSettings>? configureSettings, Action<IServiceProvider, ConsumerBuilder<TKey, TValue>>? configureBuilder)
56/// <inheritdoc cref="AddKeyedKafkaConsumer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaConsumerSettings}?, Action{IServiceProvider, ConsumerBuilder{TKey, TValue}}?)"/>
64/// <inheritdoc cref="AddKeyedKafkaConsumer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaConsumerSettings}?, Action{IServiceProvider, ConsumerBuilder{TKey, TValue}}?)"/>
72/// <inheritdoc cref="AddKeyedKafkaConsumer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaConsumerSettings}?, Action{IServiceProvider, ConsumerBuilder{TKey, TValue}}?)"/>
80/// <inheritdoc cref="AddKeyedKafkaConsumer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaConsumerSettings}?, Action{IServiceProvider, ConsumerBuilder{TKey, TValue}}?)"/>
81public static void AddKeyedKafkaConsumer<TKey, TValue>(this IHostApplicationBuilder builder, string name, Action<IServiceProvider, ConsumerBuilder<TKey, TValue>>? configureBuilder)
88/// <inheritdoc cref="AddKeyedKafkaConsumer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaConsumerSettings}?, Action{IServiceProvider, ConsumerBuilder{TKey, TValue}}?)"/>
104public static void AddKeyedKafkaConsumer<TKey, TValue>(this IHostApplicationBuilder builder, string name, Action<KafkaConsumerSettings>? configureSettings, Action<IServiceProvider, ConsumerBuilder<TKey, TValue>>? configureBuilder)
114Action<IServiceProvider, ConsumerBuilder<TKey, TValue>>? configureBuilder,
193IServiceProvider serviceProvider, KafkaConsumerSettings settings, string? key = null)
201private static InstrumentedConsumerBuilder<TKey, TValue> CreateConsumerBuilder<TKey, TValue>(IServiceProvider serviceProvider, Action<IServiceProvider, ConsumerBuilder<TKey, TValue>>? configureBuilder, KafkaConsumerSettings settings)
271private static Action<IServiceProvider, ConsumerBuilder<TKey, TValue>>? Wrap<TKey, TValue>(Action<ConsumerBuilder<TKey, TValue>>? action)
AspireKafkaProducerExtensions.cs (19)
25/// <inheritdoc cref="AddKafkaProducer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaProducerSettings}?, Action{IServiceProvider, ProducerBuilder{TKey, TValue}}?)"/>
29/// <inheritdoc cref="AddKafkaProducer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaProducerSettings}?, Action{IServiceProvider, ProducerBuilder{TKey, TValue}}?)"/>
33/// <inheritdoc cref="AddKafkaProducer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaProducerSettings}?, Action{IServiceProvider, ProducerBuilder{TKey, TValue}}?)"/>
37/// <inheritdoc cref="AddKafkaProducer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaProducerSettings}?, Action{IServiceProvider, ProducerBuilder{TKey, TValue}}?)"/>
38public static void AddKafkaProducer<TKey, TValue>(this IHostApplicationBuilder builder, string connectionName, Action<IServiceProvider, ProducerBuilder<TKey, TValue>>? configureBuilder)
41/// <inheritdoc cref="AddKafkaProducer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaProducerSettings}?, Action{IServiceProvider, ProducerBuilder{TKey, TValue}}?)"/>
53public static void AddKafkaProducer<TKey, TValue>(this IHostApplicationBuilder builder, string connectionName, Action<KafkaProducerSettings>? configureSettings, Action<IServiceProvider, ProducerBuilder<TKey, TValue>>? configureBuilder)
56/// <inheritdoc cref="AddKeyedKafkaProducer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaProducerSettings}?, Action{IServiceProvider, ProducerBuilder{TKey, TValue}}?)"/>
64/// <inheritdoc cref="AddKeyedKafkaProducer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaProducerSettings}?, Action{IServiceProvider, ProducerBuilder{TKey, TValue}}?)"/>
72/// <inheritdoc cref="AddKeyedKafkaProducer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaProducerSettings}?, Action{IServiceProvider, ProducerBuilder{TKey, TValue}}?)"/>
80/// <inheritdoc cref="AddKeyedKafkaProducer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaProducerSettings}?, Action{IServiceProvider, ProducerBuilder{TKey, TValue}}?)"/>
81public static void AddKeyedKafkaProducer<TKey, TValue>(this IHostApplicationBuilder builder, string name, Action<IServiceProvider, ProducerBuilder<TKey, TValue>>? configureBuilder)
88/// <inheritdoc cref="AddKeyedKafkaProducer{TKey, TValue}(IHostApplicationBuilder, string, Action{KafkaProducerSettings}?, Action{IServiceProvider, ProducerBuilder{TKey, TValue}}?)"/>
104public static void AddKeyedKafkaProducer<TKey, TValue>(this IHostApplicationBuilder builder, string name, Action<KafkaProducerSettings>? configureSettings, Action<IServiceProvider, ProducerBuilder<TKey, TValue>>? configureBuilder)
114Action<IServiceProvider, ProducerBuilder<TKey, TValue>>? configureBuilder,
193IServiceProvider serviceProvider, KafkaProducerSettings settings, string? key = null)
201private static InstrumentedProducerBuilder<TKey, TValue> CreateProducerBuilder<TKey, TValue>(IServiceProvider serviceProvider, Action<IServiceProvider, ProducerBuilder<TKey, TValue>>? configureBuilder, KafkaProducerSettings settings)
272private static Action<IServiceProvider, ProducerBuilder<TKey, TValue>>? Wrap<TKey, TValue>(Action<ProducerBuilder<TKey, TValue>>? action)
Aspire.Confluent.Kafka.Tests (10)
ConfluentKafkaPublicApiTests.cs (8)
25Action<IServiceProvider, ConsumerBuilder<string, string>>? configureBuilderWithServiceProvider = null;
61Action<IServiceProvider, ConsumerBuilder<string, string>>? configureBuilderWithServiceProvider = null;
93Action<IServiceProvider, ConsumerBuilder<string, string>>? configureBuilderWithServiceProvider = null;
129Action<IServiceProvider, ConsumerBuilder<string, string>>? configureBuilderWithServiceProvider = null;
161Action<IServiceProvider, ProducerBuilder<string, string>>? configureBuilderWithServiceProvider = null;
197Action<IServiceProvider, ProducerBuilder<string, string>>? configureBuilderWithServiceProvider = null;
229Action<IServiceProvider, ProducerBuilder<string, string>>? configureBuilderWithServiceProvider = null;
265Action<IServiceProvider, ProducerBuilder<string, string>>? configureBuilderWithServiceProvider = null;
Aspire.Dashboard (5)
Aspire.Hosting (81)
Aspire.Hosting.Azure (1)
Aspire.Hosting.MySql (1)
Aspire.Hosting.PostgreSQL (1)
Aspire.Hosting.SqlServer (1)
Aspire.Hosting.Testing (2)
Aspire.Hosting.Tests (9)
Aspire.Milvus.Client (1)
Aspire.MongoDB.Driver (1)
Aspire.NATS.Net (17)
AspireNatsClientExtensions.cs (17)
24/// <inheritdoc cref="AddNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/>
28/// <inheritdoc cref="AddNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/>
32/// <inheritdoc cref="AddNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/>
36/// <inheritdoc cref="AddNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/>
37public static void AddNatsClient(this IHostApplicationBuilder builder, string connectionName, Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptions)
40/// <inheritdoc cref="AddNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/>
54public static void AddNatsClient(this IHostApplicationBuilder builder, string connectionName, Action<NatsClientSettings>? configureSettings, Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptions)
59/// <inheritdoc cref="AddKeyedNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/>
67/// <inheritdoc cref="AddKeyedNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/>
75/// <inheritdoc cref="AddKeyedNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/>
83/// <inheritdoc cref="AddKeyedNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/>
84public static void AddKeyedNatsClient(this IHostApplicationBuilder builder, string name, Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptions)
91/// <inheritdoc cref="AddKeyedNatsClient(IHostApplicationBuilder, string, Action{NatsClientSettings}?, Func{IServiceProvider,NatsOpts,NatsOpts}?)"/>
110public static void AddKeyedNatsClient(this IHostApplicationBuilder builder, string name, Action<NatsClientSettings>? configureSettings, Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptions)
117private static void AddNatsClientInternal(this IHostApplicationBuilder builder, string connectionName, object? serviceKey, Action<NatsClientSettings>? configureSettings, Func<IServiceProvider, NatsOpts, NatsOpts>? configureOptions)
135NatsConnection Factory(IServiceProvider provider)
206private static Func<IServiceProvider, NatsOpts, NatsOpts>? Wrap(Func<NatsOpts, NatsOpts>? func)
Aspire.NATS.Net.Tests (5)
Aspire.OpenAI (3)
Aspire.Pomelo.EntityFrameworkCore.MySql (1)
Aspire.Qdrant.Client (1)
Aspire.RabbitMQ.Client (1)
Aspire.StackExchange.Redis (8)
Aspire.StackExchange.Redis.DistributedCaching (3)
Aspire.StackExchange.Redis.OutputCaching (3)
BasicWebSite (5)
BasketService (1)
CatalogDb (1)
ConfigurationSchemaGenerator.Tests (1)
CustomEncryptorSample (3)
CustomResources.AppHost (1)
DatabaseMigration.MigrationService (1)
DesignSurfaceExt (3)
GenericHostWebSite (1)
GetDocument.Insider (6)
InMemory.FunctionalTests (1)
IStartupInjectionAssemblyName (1)
Microsoft.Analyzers.Local.Tests (1)
Microsoft.AspNetCore (5)
Microsoft.AspNetCore.Antiforgery.Test (4)
Microsoft.AspNetCore.Authentication.BearerToken (2)
Microsoft.AspNetCore.Authentication.Test (1)
Microsoft.AspNetCore.Authorization.Policy (5)
Microsoft.AspNetCore.Authorization.Test (3)
Microsoft.AspNetCore.Components (36)
CascadingValueServiceCollectionExtensions.cs (6)
23this IServiceCollection serviceCollection, Func<IServiceProvider, TValue> initialValueFactory)
36this IServiceCollection serviceCollection, string name, Func<IServiceProvider, TValue> initialValueFactory)
52this IServiceCollection serviceCollection, Func<IServiceProvider, CascadingValueSource<TValue>> sourceFactory)
65this IServiceCollection serviceCollection, Func<IServiceProvider, TValue> valueFactory)
83this IServiceCollection serviceCollection, string name, Func<IServiceProvider, TValue> valueFactory)
104this IServiceCollection serviceCollection, Func<IServiceProvider, CascadingValueSource<TValue>> sourceFactory)
Microsoft.AspNetCore.Components.Authorization.Tests (2)
Microsoft.AspNetCore.Components.Endpoints (2)
Microsoft.AspNetCore.Components.Endpoints.Tests (26)
Microsoft.AspNetCore.Components.Forms (5)
Microsoft.AspNetCore.Components.Forms.Tests (3)
Microsoft.AspNetCore.Components.Performance (1)
Microsoft.AspNetCore.Components.QuickGrid (2)
Microsoft.AspNetCore.Components.Server (6)
Microsoft.AspNetCore.Components.Server.Tests (25)
Microsoft.AspNetCore.Components.Tests (28)
Microsoft.AspNetCore.Components.Web (6)
Microsoft.AspNetCore.Components.Web.Tests (48)
Microsoft.AspNetCore.Components.WebAssembly (7)
Microsoft.AspNetCore.Components.WebAssembly.Server (5)
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Microsoft.AspNetCore.Components.WebView (6)
Microsoft.AspNetCore.Components.WebView.Maui (2)
Microsoft.AspNetCore.Components.WebView.Photino (2)
Microsoft.AspNetCore.Components.WebView.Test (1)
Microsoft.AspNetCore.Components.WebView.WindowsForms (5)
Microsoft.AspNetCore.Components.WebView.Wpf (6)
Microsoft.AspNetCore.Connections.Abstractions (17)
Microsoft.AspNetCore.DataProtection (34)
Microsoft.AspNetCore.DataProtection.Abstractions (10)
Microsoft.AspNetCore.DataProtection.Abstractions.Tests (14)
Microsoft.AspNetCore.DataProtection.EntityFrameworkCore (2)
Microsoft.AspNetCore.DataProtection.Tests (8)
Microsoft.AspNetCore.Diagnostics (6)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Microsoft.AspNetCore.Grpc.JsonTranscoding (6)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (4)
Microsoft.AspNetCore.HeaderParsing (2)
Microsoft.AspNetCore.Hosting (55)
Internal\StartupLoader.cs (16)
41public static StartupMethods LoadMethods(IServiceProvider hostingServiceProvider, [DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType, string environmentName, object? instance = null)
83public abstract Func<IServiceCollection, IServiceProvider> Build();
89IServiceProvider hostingServiceProvider,
100public IServiceProvider HostingServiceProvider { get; }
105public override Func<IServiceCollection, IServiceProvider> Build()
132Func<IServiceCollection, IServiceProvider> ConfigureServices(
133Func<IServiceCollection, IServiceProvider?> configureServicesCallback,
138IServiceProvider ConfigureServicesWithContainerConfiguration(IServiceCollection services)
141var applicationServiceProvider = configureServicesCallback.Invoke(services);
168private Func<IServiceCollection, IServiceProvider?> BuildStartupServicesFilterPipeline(Func<IServiceCollection, IServiceProvider?> startup)
172IServiceProvider? RunPipeline(IServiceCollection services)
198var result = startup(serviceCollection);
203var message = $"A ConfigureServices method that returns an {nameof(IServiceProvider)} is " +
308return null != FindMethod(startupType, "Configure{0}Services", environmentName, typeof(IServiceProvider), required: false);
313var servicesMethod = FindMethod(startupType, "Configure{0}Services", environmentName, typeof(IServiceProvider), required: false)
Microsoft.AspNetCore.Hosting.Abstractions (3)
Microsoft.AspNetCore.Hosting.Tests (27)
Microsoft.AspNetCore.Http (17)
Microsoft.AspNetCore.Http.Abstractions (17)
Extensions\UseMiddlewareExtensions.cs (8)
145var serviceProvider = context.RequestServices ?? _app.ApplicationServices;
148throw new InvalidOperationException(Resources.FormatException_UseMiddlewareIServiceProviderNotAvailable(nameof(IServiceProvider)));
200private static Func<T, HttpContext, IServiceProvider, Task> ReflectionFallback<T>(MethodInfo methodInfo, ParameterInfo[] parameters)
265private static Func<T, HttpContext, IServiceProvider, Task> CompileExpression<T>(MethodInfo methodInfo, ParameterInfo[] parameters)
298var providerArg = Expression.Parameter(typeof(IServiceProvider), "serviceProvider");
323var lambda = Expression.Lambda<Func<T, HttpContext, IServiceProvider, Task>>(body, instanceArg, httpContextArg, providerArg);
328private static object GetService(IServiceProvider sp, Type type, Type middleware)
335private static object GetKeyedService(IServiceProvider sp, object key, Type type, Type middleware)
Microsoft.AspNetCore.Http.Abstractions.Tests (9)
Microsoft.AspNetCore.Http.Extensions (9)
RequestDelegateFactory.cs (6)
56private static readonly MethodInfo GetRequiredServiceMethod = typeof(ServiceProviderServiceExtensions).GetMethod(nameof(ServiceProviderServiceExtensions.GetRequiredService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider) })!;
57private static readonly MethodInfo GetServiceMethod = typeof(ServiceProviderServiceExtensions).GetMethod(nameof(ServiceProviderServiceExtensions.GetService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider) })!;
58private static readonly MethodInfo GetRequiredKeyedServiceMethod = typeof(ServiceProviderKeyedServiceExtensions).GetMethod(nameof(ServiceProviderKeyedServiceExtensions.GetRequiredKeyedService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider), typeof(object) })!;
59private static readonly MethodInfo GetKeyedServiceMethod = typeof(ServiceProviderKeyedServiceExtensions).GetMethod(nameof(ServiceProviderKeyedServiceExtensions.GetKeyedService), BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(IServiceProvider), typeof(object) })!;
275var serviceProvider = options?.ServiceProvider ?? options?.EndpointBuilder?.ApplicationServices ?? EmptyServiceProvider.Instance;
2888public RdfEndpointBuilder(IServiceProvider applicationServices)
Microsoft.AspNetCore.Http.Extensions.Tests (24)
ValidationsGenerator\ValidationsGeneratorTestBase.cs (10)
82if (TryResolveServicesFromCompilation(compilation, targetAssemblyName: "Microsoft.AspNetCore.Http.Abstractions", typeName: "Microsoft.AspNetCore.Http.Validation.ValidationOptions", out var services, out var serviceType, out var outputAssemblyName) is false)
99internal static async Task VerifyEndpoint(Compilation compilation, string routePattern, Func<Endpoint, IServiceProvider, Task> verifyFunc)
101if (TryResolveServicesFromCompilation(compilation, targetAssemblyName: "Microsoft.AspNetCore.Routing", typeName: "Microsoft.AspNetCore.Routing.EndpointDataSource", out var services, out var serviceType, out var outputAssemblyName) is false)
111private static bool TryResolveServicesFromCompilation(Compilation compilation, string targetAssemblyName, string typeName, out IServiceProvider serviceProvider, out Type serviceType, out string outputAssemblyName)
187var services = ((IHost)factory([$"--{HostDefaults.ApplicationKey}={assemblyName}"])).Services;
307public static Func<string[], IServiceProvider> ResolveServiceProviderFactory(Assembly assembly, TimeSpan waitTimeout = default)
370private static IServiceProvider GetServiceProvider(object host)
378return (IServiceProvider)servicesProperty.GetValue(host);
555internal HttpContext CreateHttpContext(IServiceProvider serviceProvider)
566internal HttpContext CreateHttpContextWithPayload(string requestData, IServiceProvider serviceProvider = null)
Microsoft.AspNetCore.Http.Features (3)
Microsoft.AspNetCore.Http.Microbenchmarks (7)
Microsoft.AspNetCore.Http.Results.Tests (29)
Microsoft.AspNetCore.Http.Tests (1)
Microsoft.AspNetCore.Identity (12)
IdentityApiEndpointRouteBuilderExtensions.cs (10)
58([FromBody] RegisterRequest registration, HttpContext context, [FromServices] IServiceProvider sp) =>
91([FromBody] LoginRequest login, [FromQuery] bool? useCookies, [FromQuery] bool? useSessionCookies, [FromServices] IServiceProvider sp) =>
123([FromBody] RefreshRequest refreshRequest, [FromServices] IServiceProvider sp) =>
143([FromQuery] string userId, [FromQuery] string code, [FromQuery] string? changedEmail, [FromServices] IServiceProvider sp) =>
194([FromBody] ResendConfirmationEmailRequest resendRequest, HttpContext context, [FromServices] IServiceProvider sp) =>
207([FromBody] ForgotPasswordRequest resetRequest, [FromServices] IServiceProvider sp) =>
226([FromBody] ResetPasswordRequest resetRequest, [FromServices] IServiceProvider sp) =>
261(ClaimsPrincipal claimsPrincipal, [FromBody] TwoFactorRequest tfaRequest, [FromServices] IServiceProvider sp) =>
337(ClaimsPrincipal claimsPrincipal, [FromServices] IServiceProvider sp) =>
349(ClaimsPrincipal claimsPrincipal, [FromBody] InfoRequest infoRequest, HttpContext context, [FromServices] IServiceProvider sp) =>
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Microsoft.AspNetCore.InternalTesting (5)
AssemblyTestLog.cs (5)
36private readonly IServiceProvider _serviceProvider;
46private AssemblyTestLog(ILoggerFactory globalLoggerFactory, ILogger globalLogger, string baseDirectory, Assembly assembly, IServiceProvider serviceProvider)
69var serviceProvider = CreateLoggerServices(output, className, minLogLevel, out resolvedTestName, out logOutputDirectory, testName, logStart);
101public IServiceProvider CreateLoggerServices(ITestOutputHelper output, string className, LogLevel minLogLevel, out string normalizedTestName, [CallerMemberName] string testName = null, DateTimeOffset? logStart = null)
105public IServiceProvider CreateLoggerServices(ITestOutputHelper output, string className, LogLevel minLogLevel, out string normalizedTestName, out string logOutputDirectory, [CallerMemberName] string testName = null, DateTimeOffset? logStart = null)
Microsoft.AspNetCore.MiddlewareAnalysis (1)
Microsoft.AspNetCore.Mvc.Abstractions (7)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
Microsoft.AspNetCore.Mvc.Core (44)
Microsoft.AspNetCore.Mvc.Core.Test (86)
Microsoft.AspNetCore.Mvc.Core.TestCommon (3)
Microsoft.AspNetCore.Mvc.Cors (1)
Microsoft.AspNetCore.Mvc.IntegrationTests (7)
Microsoft.AspNetCore.Mvc.Razor (9)
Microsoft.AspNetCore.Mvc.Razor.Test (3)
Microsoft.AspNetCore.Mvc.RazorPages (8)
Microsoft.AspNetCore.Mvc.RazorPages.Test (32)
Infrastructure\DefaultPageLoaderTest.cs (7)
20private readonly IOptions<RazorPagesOptions> RazorPagesOptions = Options.Create(new RazorPagesOptions { Conventions = new PageConventionCollection(Mock.Of<IServiceProvider>()) });
38var endpointFactory = new ActionEndpointFactory(Mock.Of<RoutePatternTransformer>(), Enumerable.Empty<IRequestDelegateFactory>(), Mock.Of<IServiceProvider>());
121var endpointFactory = new ActionEndpointFactory(transformer.Object, Enumerable.Empty<IRequestDelegateFactory>(), Mock.Of<IServiceProvider>());
161var endpointFactory = new ActionEndpointFactory(Mock.Of<RoutePatternTransformer>(), Enumerable.Empty<IRequestDelegateFactory>(), Mock.Of<IServiceProvider>());
238var endpointFactory = new ActionEndpointFactory(transformer.Object, Enumerable.Empty<IRequestDelegateFactory>(), Mock.Of<IServiceProvider>());
300var endpointFactory = new ActionEndpointFactory(transformer.Object, Enumerable.Empty<IRequestDelegateFactory>(), Mock.Of<IServiceProvider>());
337var endpointFactory = new ActionEndpointFactory(Mock.Of<RoutePatternTransformer>(), Enumerable.Empty<IRequestDelegateFactory>(), Mock.Of<IServiceProvider>());
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.Mvc.Test (2)
Microsoft.AspNetCore.Mvc.Testing (6)
Microsoft.AspNetCore.Mvc.ViewFeatures (17)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (28)
Microsoft.AspNetCore.OpenApi (25)
Services\OpenApiDocumentService.cs (13)
41IServiceProvider serviceProvider,
61public async Task<OpenApiDocument> GetOpenApiDocumentAsync(IServiceProvider scopedServiceProvider, HttpRequest? httpRequest = null, CancellationToken cancellationToken = default)
103private async Task ApplyTransformersAsync(OpenApiDocument document, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, CancellationToken cancellationToken)
121internal void InitializeTransformers(IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, IOpenApiOperationTransformer[] operationTransformers)
243IServiceProvider scopedServiceProvider,
264IServiceProvider scopedServiceProvider,
310IServiceProvider scopedServiceProvider,
364IServiceProvider scopedServiceProvider,
399IServiceProvider scopedServiceProvider,
438IServiceProvider scopedServiceProvider,
506private async Task<OpenApiRequestBody?> GetRequestBodyAsync(OpenApiDocument document, ApiDescription description, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, CancellationToken cancellationToken)
529IServiceProvider scopedServiceProvider,
691IServiceProvider scopedServiceProvider,
Services\Schemas\OpenApiSchemaService.cs (3)
121internal async Task<OpenApiSchema> GetOrCreateUnresolvedSchemaAsync(OpenApiDocument? document, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default)
140internal async Task<IOpenApiSchema> GetOrCreateSchemaAsync(OpenApiDocument document, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default)
257internal async Task ApplySchemaTransformersAsync(OpenApiDocument? document, IOpenApiSchema schema, Type type, IServiceProvider scopedServiceProvider, IOpenApiSchemaTransformer[] schemaTransformers, ApiParameterDescription? parameterDescription = null, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.OpenApi.Microbenchmarks (2)
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (4)
Microsoft.AspNetCore.OpenApi.Tests (16)
Microsoft.AspNetCore.OutputCaching (4)
Microsoft.AspNetCore.OutputCaching.Tests (2)
Microsoft.AspNetCore.Owin (3)
Microsoft.AspNetCore.Owin.Tests (4)
Microsoft.AspNetCore.RateLimiting (4)
Microsoft.AspNetCore.RateLimiting.Tests (9)
Microsoft.AspNetCore.ResponseCompression (6)
Microsoft.AspNetCore.Routing (35)
Microsoft.AspNetCore.Routing.Microbenchmarks (10)
Microsoft.AspNetCore.Routing.Tests (35)
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Microsoft.AspNetCore.Shared.Tests (7)
Microsoft.AspNetCore.SignalR.Client.Core (7)
Microsoft.AspNetCore.SignalR.Client.Tests (3)
Microsoft.AspNetCore.SignalR.Core (17)
Internal\DefaultHubDispatcher.cs (4)
606private ValueTask<object?> ExecuteHubMethod(ObjectMethodExecutor methodExecutor, THub hub, object?[] arguments, HubConnectionContext connection, IServiceProvider serviceProvider)
665private static Task<bool> IsHubMethodAuthorized(IServiceProvider provider, HubConnectionContext hubConnectionContext, HubMethodDescriptor descriptor, object?[] hubMethodArguments, Hub hub)
676private static async Task<bool> IsHubMethodAuthorizedSlow(IServiceProvider provider, ClaimsPrincipal principal, IList<IAuthorizeData> policies, HubInvocationContext resource)
832private static Activity? StartActivity(string operationName, ActivityKind kind, Activity? linkedActivity, IServiceProvider serviceProvider, string methodName, IDictionary<string, string>? headers, ILogger logger)
Microsoft.AspNetCore.SignalR.Tests (185)
HubConnectionHandlerTests.cs (134)
44var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(s => s.AddSingleton(trackDispose), LoggerFactory);
67var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(s =>
98var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(s => s.AddSingleton(state), LoggerFactory);
122var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
148var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
172var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
194var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
220var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
231var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
242var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
698var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
740var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
772var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
798var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
824var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
850var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
914var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
987var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1014var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1043var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1068var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1094var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1129var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1157var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1182var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1207var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1232var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1257var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1276var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1301var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1334var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1359var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1409var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
1882var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
2009var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
2044var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
2089var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
2128var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
2193var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2229var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2278var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(loggerFactory: LoggerFactory);
2329var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2374var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2416var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
2446var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2485var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2509var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2546var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2612var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
2643var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
2668var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
2695var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2741var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2803var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2839var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2867var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
2902var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3010var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3069var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3104var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
3141var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
3176var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3214var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
3249var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
3284var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
3321var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
3376var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
3432var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
3502var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
3556var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3589var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3620var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider();
3643var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider();
3671var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider();
3726var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3767var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3798var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3820var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(s => s.AddSingleton(state), LoggerFactory);
3843var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(s => s.AddSingleton(state), LoggerFactory);
3867var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(loggerFactory: LoggerFactory);
3918var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(loggerFactory: LoggerFactory);
3942var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3967var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
3994var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(loggerFactory: LoggerFactory);
4014var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(loggerFactory: LoggerFactory);
4033var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(loggerFactory: LoggerFactory);
4052var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
4090var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
4130var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(loggerFactory: LoggerFactory);
4167var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(loggerFactory: LoggerFactory);
4210var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
4251var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
4296var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
4327var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
4354var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(builder =>
4383var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
4408IServiceProvider serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(loggerFactory: LoggerFactory);
4473var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(
4507var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(services =>
4537var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
4562var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider();
4593var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(serviceBuilder =>
4627var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(null, LoggerFactory);
4652var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4669var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4687var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4704var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4723var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4750var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4767var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4789var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4810var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4831var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4856var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4879var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4901var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4921var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4941var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4964var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
4987var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
5011var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
5034var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
5057var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
5071var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
5087var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
5098var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
5134var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(s => s.AddSingleton(state), LoggerFactory);
5158var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(s => s.AddSingleton(state), LoggerFactory);
5183var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
5210var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(provider =>
5262var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(s => s.AddSingleton(state), LoggerFactory);
5325var serviceProvider = HubConnectionHandlerTestUtils.CreateServiceProvider(s => s.AddSingleton(state), LoggerFactory);
5382private readonly IServiceProvider _serviceProvider;
5386public CustomHubActivator(IServiceProvider serviceProvider)
Microsoft.AspNetCore.SignalR.Tests.Utils (2)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (3)
Microsoft.AspNetCore.StaticAssets (5)
Microsoft.AspNetCore.TestHost (8)
Microsoft.AspNetCore.TestHost.Tests (10)
Microsoft.AspNetCore.Testing.Tests (1)
Microsoft.AspNetCore.Tests (3)
Microsoft.CodeAnalysis.EditorFeatures (7)
Microsoft.CodeAnalysis.Remote.ServiceHub (6)
Microsoft.Extensions.AI (32)
Embeddings\EmbeddingGeneratorBuilder.cs (7)
18private readonly Func<IServiceProvider, IEmbeddingGenerator<TInput, TEmbedding>> _innerGeneratorFactory;
21private List<Func<IEmbeddingGenerator<TInput, TEmbedding>, IServiceProvider, IEmbeddingGenerator<TInput, TEmbedding>>>? _generatorFactories;
34public EmbeddingGeneratorBuilder(Func<IServiceProvider, IEmbeddingGenerator<TInput, TEmbedding>> innerGeneratorFactory)
43/// The <see cref="IServiceProvider"/> that should provide services to the <see cref="IEmbeddingGenerator{TInput, TEmbedding}"/> instances.
44/// If <see langword="null"/>, an empty <see cref="IServiceProvider"/> will be used.
47public IEmbeddingGenerator<TInput, TEmbedding> Build(IServiceProvider? services = null)
86Func<IEmbeddingGenerator<TInput, TEmbedding>, IServiceProvider, IEmbeddingGenerator<TInput, TEmbedding>> generatorFactory)
Microsoft.Extensions.AI.Abstractions (18)
Microsoft.Extensions.AI.Abstractions.Tests (5)
Microsoft.Extensions.AI.Integration.Tests (2)
Microsoft.Extensions.AI.Tests (29)
Microsoft.Extensions.Caching.Hybrid (4)
Microsoft.Extensions.Caching.StackExchangeRedis (3)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (1)
Microsoft.Extensions.Compliance.Testing (1)
Microsoft.Extensions.DependencyInjection (18)
ServiceLookup\FactoryCallSite.cs (3)
10public Func<IServiceProvider, object> Factory { get; }
12public FactoryCallSite(ResultCache cache, Type serviceType, Func<IServiceProvider, object> factory) : base(cache, null)
18public FactoryCallSite(ResultCache cache, Type serviceType, object serviceKey, Func<IServiceProvider, object, object> factory) : base(cache, serviceKey)
Microsoft.Extensions.DependencyInjection.Abstractions (143)
ActivatorUtilities.cs (22)
38new Func<IServiceProvider, Type, Type, bool, object?, object?>(GetService).Method;
41/// Instantiates a type with constructor arguments provided directly and/or from an <see cref="IServiceProvider"/>.
48IServiceProvider provider,
263/// and/or from an <see cref="IServiceProvider"/>.
270/// A factory that will instantiate instanceType using an <see cref="IServiceProvider"/>
300/// and/or from an <see cref="IServiceProvider"/>.
307/// A factory that will instantiate type <typeparamref name="T" /> using an <see cref="IServiceProvider"/>
335provider = Expression.Parameter(typeof(IServiceProvider), "provider");
341/// Instantiates a type with constructor arguments provided directly and/or from an <see cref="IServiceProvider"/>.
347public static T CreateInstance<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IServiceProvider provider, params object[] parameters)
358public static T GetServiceOrCreateInstance<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(IServiceProvider provider)
370IServiceProvider provider,
376private static object? GetService(IServiceProvider sp, Type type, Type requiredBy, bool hasDefaultValue, object? key)
451return (IServiceProvider serviceProvider, object?[]? arguments) =>
770public object? GetService(IServiceProvider serviceProvider, int parameterIndex)
853public object CreateInstance(IServiceProvider provider)
921IServiceProvider serviceProvider)
960IServiceProvider serviceProvider)
977IServiceProvider serviceProvider,
1112IServiceProvider serviceProvider,
1137IServiceProvider serviceProvider,
1207private static object? GetKeyedService(IServiceProvider provider, Type type, object? serviceKey)
Extensions\ServiceCollectionDescriptorExtensions.Keyed.cs (6)
67Func<IServiceProvider, object?, object> implementationFactory)
122Func<IServiceProvider, object?, TService> implementationFactory)
183Func<IServiceProvider, object?, object> implementationFactory)
238Func<IServiceProvider, object?, TService> implementationFactory)
299Func<IServiceProvider, object?, object> implementationFactory)
373Func<IServiceProvider, object?, TService> implementationFactory)
ServiceCollectionServiceExtensions.cs (10)
49Func<IServiceProvider, object> implementationFactory)
123Func<IServiceProvider, TService> implementationFactory)
146Func<IServiceProvider, TImplementation> implementationFactory)
191Func<IServiceProvider, object> implementationFactory)
265Func<IServiceProvider, TService> implementationFactory)
288Func<IServiceProvider, TImplementation> implementationFactory)
334Func<IServiceProvider, object> implementationFactory)
408Func<IServiceProvider, TService> implementationFactory)
431Func<IServiceProvider, TImplementation> implementationFactory)
499Func<IServiceProvider, object> implementationFactory,
ServiceCollectionServiceExtensions.Keyed.cs (10)
53Func<IServiceProvider, object?, object> implementationFactory)
137Func<IServiceProvider, object?, TService> implementationFactory)
162Func<IServiceProvider, object?, TImplementation> implementationFactory)
211Func<IServiceProvider, object?, object> implementationFactory)
295Func<IServiceProvider, object?, TService> implementationFactory)
320Func<IServiceProvider, object?, TImplementation> implementationFactory)
369Func<IServiceProvider, object?, object> implementationFactory)
453Func<IServiceProvider, object?, TService> implementationFactory)
478Func<IServiceProvider, object?, TImplementation> implementationFactory)
552Func<IServiceProvider, object?, object> implementationFactory,
ServiceDescriptor.cs (27)
91Func<IServiceProvider, object> factory,
111Func<IServiceProvider, object?, object> factory,
121Func<IServiceProvider, object> nullKeyedFactory = sp => factory(sp, null);
224public Func<IServiceProvider, object>? ImplementationFactory => IsKeyedService ? null : (Func<IServiceProvider, object>?) _implementationFactory;
233public Func<IServiceProvider, object?, object>? KeyedImplementationFactory
241return (Func<IServiceProvider, object?, object>?)_implementationFactory;
432Func<IServiceProvider, TImplementation> implementationFactory)
454Func<IServiceProvider, object?, TImplementation> implementationFactory)
471public static ServiceDescriptor Transient<TService>(Func<IServiceProvider, TService> implementationFactory)
488public static ServiceDescriptor KeyedTransient<TService>(object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory)
504public static ServiceDescriptor Transient(Type service, Func<IServiceProvider, object> implementationFactory)
521public static ServiceDescriptor KeyedTransient(Type service, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory)
603Func<IServiceProvider, TImplementation> implementationFactory)
625Func<IServiceProvider, object?, TImplementation> implementationFactory)
642public static ServiceDescriptor Scoped<TService>(Func<IServiceProvider, TService> implementationFactory)
659public static ServiceDescriptor KeyedScoped<TService>(object? serviceKey, Func<IServiceProvider, object?, TService> implementationFactory)
675public static ServiceDescriptor Scoped(Type service, Func<IServiceProvider, object> implementationFactory)
692public static ServiceDescriptor KeyedScoped(Type service, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory)
781Func<IServiceProvider, TImplementation> implementationFactory)
803Func<IServiceProvider, object?, TImplementation> implementationFactory)
820public static ServiceDescriptor Singleton<TService>(Func<IServiceProvider, TService> implementationFactory)
839Func<IServiceProvider, object?, TService> implementationFactory)
857Func<IServiceProvider, object> implementationFactory)
877Func<IServiceProvider, object?, object> implementationFactory)
1016public static ServiceDescriptor Describe(Type serviceType, Func<IServiceProvider, object> implementationFactory, ServiceLifetime lifetime)
1031public static ServiceDescriptor DescribeKeyed(Type serviceType, object? serviceKey, Func<IServiceProvider, object?, object> implementationFactory, ServiceLifetime lifetime)
Microsoft.Extensions.DependencyInjection.AutoActivation (12)
AutoActivationExtensions.cs (5)
98public static IServiceCollection AddActivatedSingleton<TService, TImplementation>(this IServiceCollection services, Func<IServiceProvider, TImplementation> implementationFactory)
135public static IServiceCollection AddActivatedSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)
191Func<IServiceProvider, object> implementationFactory)
262public static void TryAddActivatedSingleton(this IServiceCollection services, Type serviceType, Func<IServiceProvider, object> implementationFactory)
305public static void TryAddActivatedSingleton<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory)
AutoActivationExtensions.Keyed.cs (5)
105Func<IServiceProvider, object?, TImplementation> implementationFactory)
147Func<IServiceProvider, object?, TService> implementationFactory)
204Func<IServiceProvider, object?, object> implementationFactory)
286Func<IServiceProvider, object?, object> implementationFactory)
339Func<IServiceProvider, object?, TService> implementationFactory)
Microsoft.Extensions.Diagnostics.HealthChecks (9)
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (4)
Microsoft.Extensions.Diagnostics.Testing (1)
Microsoft.Extensions.Hosting (15)
Microsoft.Extensions.Hosting.Abstractions (6)
Microsoft.Extensions.Hosting.Testing (1)
Microsoft.Extensions.Hosting.Testing.Tests (4)
Microsoft.Extensions.Http (63)
DependencyInjection\HttpClientBuilderExtensions.cs (19)
45/// The <see cref="IServiceProvider"/> provided to <paramref name="configureClient"/> will be the
48public static IHttpClientBuilder ConfigureHttpClient(this IHttpClientBuilder builder, Action<IServiceProvider, HttpClient> configureClient)
99/// The <see cref="IServiceProvider"/> argument provided to <paramref name="configureHandler"/> will be
103public static IHttpClientBuilder AddHttpMessageHandler(this IHttpClientBuilder builder, Func<IServiceProvider, DelegatingHandler> configureHandler)
180/// The <see cref="IServiceProvider"/> argument provided to <paramref name="configureHandler"/> will be
184public static IHttpClientBuilder ConfigurePrimaryHttpMessageHandler(this IHttpClientBuilder builder, Func<IServiceProvider, HttpMessageHandler> configureHandler)
234/// The <see cref="IServiceProvider"/> argument provided to <paramref name="configureHandler"/> will be
238public static IHttpClientBuilder ConfigurePrimaryHttpMessageHandler(this IHttpClientBuilder builder, Action<HttpMessageHandler, IServiceProvider> configureHandler)
286public static IHttpClientBuilder UseSocketsHttpHandler(this IHttpClientBuilder builder, Action<SocketsHttpHandler, IServiceProvider>? configureHandler = null)
347/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
382private static TClient AddTransientHelper<TClient>(IServiceProvider s, IHttpClientBuilder builder) where TClient : class
408/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
446private static TClient AddTransientHelper<TClient, TImplementation>(IServiceProvider s, IHttpClientBuilder builder) where TClient : class where TImplementation : class, TClient
468/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
514/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
518/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(IHttpClientBuilder,Func{HttpClient,IServiceProvider,TClient})"/>
522public static IHttpClientBuilder AddTypedClient<TClient>(this IHttpClientBuilder builder, Func<HttpClient, IServiceProvider, TClient> factory)
531internal static IHttpClientBuilder AddTypedClientCore<TClient>(this IHttpClientBuilder builder, Func<HttpClient, IServiceProvider, TClient> factory, bool validateSingleType)
636public static IHttpClientBuilder ConfigureAdditionalHttpMessageHandlers(this IHttpClientBuilder builder, Action<IList<DelegatingHandler>, IServiceProvider> configureAdditionalHandlers)
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (23)
165public static IHttpClientBuilder AddHttpClient(this IServiceCollection services, string name, Action<IServiceProvider, HttpClient> configureClient)
196/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
236/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
273/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
316/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
357/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
396/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
401this IServiceCollection services, Action<IServiceProvider, HttpClient> configureClient)
439/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
483/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
488this IServiceCollection services, Action<IServiceProvider, HttpClient> configureClient)
523/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
565/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
573this IServiceCollection services, string name, Action<IServiceProvider, HttpClient> configureClient)
611/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
658/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
666this IServiceCollection services, string name, Action<IServiceProvider, HttpClient> configureClient)
703/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
740/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
782/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
786public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, Func<HttpClient, IServiceProvider, TImplementation> factory)
819/// can be retrieved from <see cref="IServiceProvider.GetService(Type)" /> (and related methods) by providing
823public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, string name, Func<HttpClient, IServiceProvider, TImplementation> factory)
Microsoft.Extensions.Http.Diagnostics (5)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Microsoft.Extensions.Http.Polly (3)
Microsoft.Extensions.Http.Resilience (16)
Resilience\Internal\PipelineKeyProviderHelper.cs (4)
21public static void SelectPipelineBy(IServiceCollection services, string pipelineName, Func<IServiceProvider, Func<HttpRequestMessage, string>> selectorFactory)
26public static Func<HttpRequestMessage, string>? GetPipelineKeyProvider(this IServiceProvider provider, string pipelineName)
31private static void UsePipelineKeyProvider(IServiceCollection services, string pipelineName, Func<IServiceProvider, Func<HttpRequestMessage, string>> factory)
33_ = services.AddOptions<PipelineKeyOptions>(pipelineName).Configure<IServiceProvider>((options, provider) => options.KeyProvider = factory(provider));
Microsoft.Extensions.Identity.Core (3)
Microsoft.Extensions.ML (4)
Microsoft.Extensions.ObjectPool.DependencyInjection (2)
Microsoft.Extensions.ServiceDiscovery (2)
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (1)
Microsoft.Extensions.Telemetry.Tests (8)
Microsoft.Extensions.WebEncoders (1)
Microsoft.Maui (59)
Microsoft.Maui.Controls (32)
Shell\ShellSection.cs (3)
320 async Task PrepareCurrentStackForBeingReplaced(ShellNavigationRequest request, ShellRouteParameters queryData, IServiceProvider services, bool? animate, List<string> globalRoutes, bool isRelativePopping)
498 Page GetOrCreateFromRoute(string route, ShellRouteParameters queryData, IServiceProvider services, bool isLast, bool isPopping)
510 internal async Task GoToAsync(ShellNavigationRequest request, ShellRouteParameters queryData, IServiceProvider services, bool? animate, bool isRelativePopping)
Microsoft.Maui.Controls.Build.Tasks (2)
Microsoft.Maui.Controls.Compatibility (2)
Microsoft.Maui.Controls.SourceGen (2)
Microsoft.Maui.Controls.Xaml (46)
ApplyPropertiesVisitor.cs (5)
368 public static bool TrySetPropertyValue(object element, XmlName propertyName, string xKey, object value, object rootElement, IXmlLineInfo lineInfo, IServiceProvider serviceProvider, out Exception xpe)
574 static bool TrySetValue(object element, BindableProperty property, bool attached, object value, IXmlLineInfo lineInfo, IServiceProvider serviceProvider, out Exception exception)
655 static bool TrySetProperty(object element, string localName, object value, IXmlLineInfo lineInfo, IServiceProvider serviceProvider, object rootElement, out Exception exception)
732 static bool TryAddToProperty(object element, XmlName propertyName, object value, string xKey, IXmlLineInfo lineInfo, IServiceProvider serviceProvider, object rootElement, out Exception exception)
802 static bool TryAddValue(BindableObject bindable, BindableProperty property, object value, IServiceProvider serviceProvider, out Exception exception)
Microsoft.Maui.Maps (3)
Microsoft.ML.AutoML (4)
Microsoft.ML.Fairlearn (2)
Microsoft.VisualStudio.LanguageServices (57)
Microsoft.VisualStudio.LanguageServices.CSharp (19)
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
Microsoft.VisualStudio.LanguageServices.Xaml (4)
MockHostTypes (4)
mscorlib (1)
Mvc.RoutingWebSite (1)
netstandard (1)
OrderProcessor (2)
PresentationFramework (137)
System\Windows\StaticResourceExtension.cs (9)
50public override object ProvideValue(IServiceProvider serviceProvider)
83internal object ProvideValueInternal(IServiceProvider serviceProvider, bool allowDeferredReference)
94internal object TryProvideValueInternal(IServiceProvider serviceProvider, bool allowDeferredReference, bool mustReturnDeferredResourceReference)
106private object TryProvideValueWithDiagnosticEvent(IServiceProvider serviceProvider, bool allowDeferredReference, bool mustReturnDeferredResourceReference)
161private object TryProvideValueImpl(IServiceProvider serviceProvider, bool allowDeferredReference, bool mustReturnDeferredResourceReference)
193private ResourceDictionary FindTheResourceDictionary(IServiceProvider serviceProvider, bool isDeferredContentSearch)
267internal object FindResourceInDeferredContent(IServiceProvider serviceProvider, bool allowDeferredReference, bool mustReturnDeferredResourceReference)
290private object FindResourceInAppOrSystem(IServiceProvider serviceProvider,
314private object FindResourceInEnviroment(IServiceProvider serviceProvider,
ReachFramework (12)
Roslyn.VisualStudio.DiagnosticsWindow (4)
SocialWeather (2)
Sockets.BindTests (1)
Sockets.FunctionalTests (1)
System.ComponentModel.Annotations (9)
System.ComponentModel.TypeConverter (8)
System.Runtime.Caching (4)
System.Windows.Forms (25)
System.Windows.Forms.Design (210)
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (5)
235public static Type[] GetCustomItemTypes(IComponent component, IServiceProvider serviceProvider)
343public static ToolStripItem[] GetCustomItemMenuItems(IComponent component, EventHandler onClick, bool convertTo, IServiceProvider serviceProvider)
367public static NewItemsContextMenuStrip GetNewItemDropDown(IComponent component, ToolStripItem currentItem, EventHandler onClick, bool convertTo, IServiceProvider serviceProvider, bool populateCustom)
404public static void GetCustomNewItemDropDown(NewItemsContextMenuStrip contextMenu, IComponent component, ToolStripItem currentItem, EventHandler onClick, bool convertTo, IServiceProvider serviceProvider)
421public static void InvalidateSelection(ArrayList originalSelComps, ToolStripItem nextSelection, IServiceProvider provider, bool shiftPressed)
System.Windows.Forms.Design.Tests (230)
System.Windows.Forms.Primitives (9)
System.Windows.Forms.Tests (9)
System.Windows.Forms.TestUtilities (4)
System.Windows.Forms.UI.IntegrationTests (3)
System.Xaml (18)
System.Xaml.Tests (5)
TestProject.ServiceA (1)
VersioningWebSite (3)
Wasm.Performance.ConsoleHost (1)
WindowsBase.Tests (3)