1 write to Services
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHostBuilder.cs (1)
72Services = new ServiceCollection();
40 references to Services
BasicTestApp (7)
Program.cs (7)
34builder.Services.AddSingleton(new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 35builder.Services.AddSingleton<AuthenticationStateProvider, ServerAuthenticationStateProvider>(); 36builder.Services.AddAuthorizationCore(options => 42builder.Services.AddScoped<PreserveStateService>(); 43builder.Services.AddTransient<FormsTest.ValidationComponentDI.SaladChef>(); 45builder.Services.AddKeyedSingleton("keyed-service-1", TestKeyedService.Create("value-1")); 46builder.Services.AddKeyedSingleton(TestServiceKey.ServiceB, TestKeyedService.Create("value-2"));
HostedBlazorWebassemblyApp.Client (2)
Program.cs (2)
24builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 25builder.Services.AddScoped<IWeatherForecastService, HttpWeatherForecastService>();
Microsoft.AspNetCore.Components.WebAssembly (19)
Hosting\WebAssemblyHostBuilder.cs (19)
73Logging = new LoggingBuilder(Services); 94return Services.BuildServiceProvider(validateScopes: WebAssemblyHostEnvironmentExtensions.IsDevelopment(hostEnvironment)); 177Services.AddSingleton<IWebAssemblyHostEnvironment>(hostEnvironment); 273var container = factory.CreateBuilder(Services); 286Services.AddSingleton<IConfiguration>(Configuration); 299Services.AddSingleton<IJSRuntime>(DefaultWebAssemblyJSRuntime.Instance); 300Services.AddSingleton<NavigationManager>(WebAssemblyNavigationManager.Instance); 301Services.AddSingleton<INavigationInterception>(WebAssemblyNavigationInterception.Instance); 302Services.AddSingleton<IScrollToLocationHash>(WebAssemblyScrollToLocationHash.Instance); 303Services.AddSingleton<IInternalJSImportMethods>(_jsMethods); 304Services.AddSingleton(new LazyAssemblyLoader(DefaultWebAssemblyJSRuntime.Instance)); 305Services.AddSingleton<RootComponentTypeCache>(_ => _rootComponentCache ?? new()); 306Services.AddSingleton<ComponentStatePersistenceManager>(); 307Services.AddSingleton<PersistentComponentState>(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State); 308Services.AddSingleton<AntiforgeryStateProvider, DefaultAntiforgeryStateProvider>(); 309Services.AddSingleton<IErrorBoundaryLogger, WebAssemblyErrorBoundaryLogger>(); 310Services.AddSingleton<ResourceCollectionProvider>(); 311Services.AddLogging(builder => 315Services.AddSupplyValueFromQueryProvider();
Microsoft.AspNetCore.Components.WebAssembly.Tests (12)
Hosting\WebAssemblyHostBuilderTest.cs (8)
42builder.Services.AddScoped<StringBuilder>(); 57builder.Services.AddScoped<StringBuilder>(); 75builder.Services.AddScoped<StringBuilder>(); 98builder.Services.AddScoped<StringBuilder>(); 99builder.Services.AddSingleton<TestServiceThatTakesStringBuilder>(); 115builder.Services.AddScoped<StringBuilder>(); 116builder.Services.AddSingleton<TestServiceThatTakesStringBuilder>(); 230Assert.Single(builder.Services, d => d.ServiceType == type);
Hosting\WebAssemblyHostTest.cs (4)
22builder.Services.AddSingleton(Mock.Of<IJSRuntime>()); 42builder.Services.AddSingleton(Mock.Of<IJSRuntime>()); 64builder.Services.AddSingleton(Mock.Of<IJSRuntime>()); 65builder.Services.AddSingleton<DisposableService>();