9 implementations of IServiceProviderFactory
Microsoft.AspNetCore (1)
ConfigureHostBuilder.cs (1)
147private sealed class ServiceProviderFactoryAdapter<TContainerBuilder> : IServiceProviderFactory<object> where TContainerBuilder : notnull
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Hosting\WebAssemblyHostBuilderTest.cs (1)
168private class MyFakeServiceProviderFactory : IServiceProviderFactory<MyFakeDIBuilderThing>
Microsoft.AspNetCore.Hosting.Tests (4)
Internal\MyBadContainerFactory.cs (1)
8public class MyBadContainerFactory : IServiceProviderFactory<MyContainer>
Internal\MyContainerFactory.cs (1)
8public class MyContainerFactory : IServiceProviderFactory<MyContainer>
WebHostBuilderTests.cs (1)
1598internal class ExternalContainerFactory : IServiceProviderFactory<IServiceCollection>
WebHostTests.AsyncDisposable.cs (1)
44private class AsyncServiceProviderFactory : IServiceProviderFactory<IServiceCollection>
Microsoft.AspNetCore.TestHost.Tests (1)
TestServerTests.cs (1)
155public class ThirdPartyContainerServiceProviderFactory : IServiceProviderFactory<ThirdPartyContainer>
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
3176private class MyServiceProviderFactory : IServiceProviderFactory<MyServiceProvider>
Microsoft.Extensions.DependencyInjection (1)
DefaultServiceProviderFactory.cs (1)
11public class DefaultServiceProviderFactory : IServiceProviderFactory<IServiceCollection>
89 references to IServiceProviderFactory
Microsoft.AspNetCore (8)
BootstrapHostBuilder.cs (2)
73public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull 79public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
ConfigureHostBuilder.cs (5)
23private IServiceProviderFactory<object>? _serviceProviderFactory; 103public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull 112public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull 149private readonly IServiceProviderFactory<TContainerBuilder> _serviceProviderFactory; 151public ServiceProviderFactoryAdapter(IServiceProviderFactory<TContainerBuilder> serviceProviderFactory)
WebApplicationBuilder.cs (1)
482void IHostApplicationBuilder.ConfigureContainer<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory, Action<TContainerBuilder>? configure) =>
Microsoft.AspNetCore.Components.WebAssembly (7)
Hosting\WebAssemblyHostBuilder.cs (7)
249/// Registers a <see cref="IServiceProviderFactory{TBuilder}" /> instance to be used to create the <see cref="IServiceProvider" />. 251/// <param name="factory">The <see cref="IServiceProviderFactory{TBuilder}" />.</param> 254/// APIS specific to the <see cref="IServiceProviderFactory{TBuilder}" /> implementation. 256/// <typeparam name="TBuilder">The type of builder provided by the <see cref="IServiceProviderFactory{TBuilder}" />.</typeparam> 259/// <see cref="ConfigureContainer{TBuilder}(IServiceProviderFactory{TBuilder}, Action{TBuilder})"/> is called by <see cref="Build"/> 263/// Multiple calls to <see cref="ConfigureContainer{TBuilder}(IServiceProviderFactory{TBuilder}, Action{TBuilder})"/> will replace 267public void ConfigureContainer<TBuilder>(IServiceProviderFactory<TBuilder> factory, Action<TBuilder>? configure = null) where TBuilder : notnull
Microsoft.AspNetCore.Hosting (13)
Internal\StartupLoader.cs (4)
151var serviceProviderFactory = HostingServiceProvider.GetRequiredService<IServiceProviderFactory<TContainerBuilder>>(); 159var serviceProviderFactory = HostingServiceProvider.GetRequiredService<IServiceProviderFactory<IServiceCollection>>();
Startup\DelegateStartup.cs (1)
23public DelegateStartup(IServiceProviderFactory<IServiceCollection> factory, Action<IApplicationBuilder> configureApp) : base(factory)
Startup\StartupBase.cs (2)
51private readonly IServiceProviderFactory<TBuilder> _factory; 57public StartupBase(IServiceProviderFactory<TBuilder> factory)
WebHostBuilder.cs (3)
201var factory = provider.GetService<IServiceProviderFactory<IServiceCollection>>(); 300services.AddTransient<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>();
WebHostBuilderExtensions.cs (3)
49return new DelegateStartup(sp.GetRequiredService<IServiceProviderFactory<IServiceCollection>>(), configureApp); 78return new DelegateStartup(sp.GetRequiredService<IServiceProviderFactory<IServiceCollection>>(), (app => configureApp(context, app))); 205services.Replace(ServiceDescriptor.Singleton<IServiceProviderFactory<IServiceCollection>>(new DefaultServiceProviderFactory(options)));
Microsoft.AspNetCore.Hosting.Tests (28)
StartupManagerTests.cs (26)
20serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 42serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 64serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 88serviceCollection.AddSingleton<IServiceProviderFactory<MyContainer>, MyContainerFactory>(); 110serviceCollection.AddSingleton<IServiceProviderFactory<MyContainer>, MyContainerFactory>(); 132serviceCollection.AddSingleton<IServiceProviderFactory<MyContainer>, MyContainerFactory>(); 293serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 311serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>>(new DefaultServiceProviderFactory(new ServiceProviderOptions 344.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>() 363serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 391.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>() 410serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 424serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 439serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 453serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 470serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 488serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 506serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 521serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 535serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>(); 550serviceCollection.AddSingleton<IServiceProviderFactory<MyContainer>, MyContainerFactory>(); 566serviceCollection.AddSingleton<IServiceProviderFactory<MyContainer>, MyContainerFactory>(); 582serviceCollection.AddSingleton<IServiceProviderFactory<MyContainer>, MyContainerFactory>(); 618serviceCollection.AddSingleton<IServiceProviderFactory<MyContainer>, MyContainerFactory>(); 628serviceCollection.AddSingleton<IServiceProviderFactory<MyContainer>, MyBadContainerFactory>(); 706public MyContainerStartupBaseClass(IServiceProviderFactory<MyContainer> factory) : base(factory)
WebHostBuilderTests.cs (1)
981services.AddSingleton<IServiceProviderFactory<IServiceCollection>>(containerFactory);
WebHostTests.AsyncDisposable.cs (1)
17services.Add(ServiceDescriptor.Singleton<IServiceProviderFactory<IServiceCollection>>(providerFactory)
Microsoft.AspNetCore.Mvc.Testing (2)
DeferredHostBuilder.cs (2)
83public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull 89public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
Microsoft.AspNetCore.TestHost.Tests (1)
TestServerTests.cs (1)
125.ConfigureServices(s => s.AddSingleton<IServiceProviderFactory<ThirdPartyContainer>, ThirdPartyContainerServiceProviderFactory>())
Microsoft.Extensions.DependencyInjection (1)
DefaultServiceProviderFactory.cs (1)
9/// Default implementation of <see cref="IServiceProviderFactory{TContainerBuilder}"/>.
Microsoft.Extensions.Hosting (9)
HostApplicationBuilder.cs (3)
213public void ConfigureContainer<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory, Action<TContainerBuilder>? configure = null) where TContainerBuilder : notnull 368public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull 377public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
HostBuilder.cs (2)
107public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull 122public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
Internal\ServiceFactoryAdapter.cs (4)
12private IServiceProviderFactory<TContainerBuilder>? _serviceProviderFactory; 14private readonly Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>>? _factoryResolver; 16public ServiceFactoryAdapter(IServiceProviderFactory<TContainerBuilder> serviceProviderFactory) 23public ServiceFactoryAdapter(Func<HostBuilderContext> contextResolver, Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factoryResolver)
Microsoft.Extensions.Hosting.Abstractions (7)
IHostApplicationBuilder.cs (5)
52/// Registers a <see cref="IServiceProviderFactory{TContainerBuilder}" /> instance to be used to create the <see cref="IServiceProvider" />. 57/// APIS specific to the <see cref="IServiceProviderFactory{TContainerBuilder}" /> implementation. 59/// <typeparam name="TContainerBuilder">The type of builder provided by the <see cref="IServiceProviderFactory{TContainerBuilder}" />.</typeparam> 66/// Multiple calls to <see cref="ConfigureContainer{TContainerBuilder}(IServiceProviderFactory{TContainerBuilder}, Action{TContainerBuilder})"/> will replace 70void ConfigureContainer<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory, Action<TContainerBuilder>? configure = null) where TContainerBuilder : notnull;
IHostBuilder.cs (2)
54IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull; 62IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull;
Microsoft.Extensions.Hosting.Testing (2)
FakeHostBuilder.cs (2)
77public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) 83public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory)
Microsoft.Extensions.Hosting.Testing.Tests (4)
FakeHostBuilderTests.cs (4)
114var factory = new Mock<IServiceProviderFactory<object>>().Object; 192var factory = new Mock<IServiceProviderFactory<object>>().Object;
Microsoft.Maui (7)
Hosting\MauiAppBuilder.cs (7)
108 /// Registers a <see cref="IServiceProviderFactory{TBuilder}" /> instance to be used to create the <see cref="IServiceProvider" />. 110 /// <param name="factory">The <see cref="IServiceProviderFactory{TBuilder}" />.</param> 113 /// APIS specific to the <see cref="IServiceProviderFactory{TBuilder}" /> implementation. 115 /// <typeparam name="TBuilder">The type of builder provided by the <see cref="IServiceProviderFactory{TBuilder}" />.</typeparam> 118 /// <see cref="ConfigureContainer{TBuilder}(IServiceProviderFactory{TBuilder}, Action{TBuilder})"/> is called by <see cref="Build"/> 122 /// Multiple calls to <see cref="ConfigureContainer{TBuilder}(IServiceProviderFactory{TBuilder}, Action{TBuilder})"/> will replace 126 public void ConfigureContainer<TBuilder>(IServiceProviderFactory<TBuilder> factory, Action<TBuilder>? configure = null) where TBuilder : notnull