1 write to Services
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHostBuilder.cs (1)
73Services = new ServiceCollection();
48 references to Services
BasicTestApp (8)
Program.cs (8)
27builder.Services.AddValidation(); 37builder.Services.AddSingleton(new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 38builder.Services.AddSingleton<AuthenticationStateProvider, ServerAuthenticationStateProvider>(); 39builder.Services.AddAuthorizationCore(options => 45builder.Services.AddScoped<PreserveStateService>(); 46builder.Services.AddTransient<FormsTest.ValidationComponentDI.SaladChef>(); 48builder.Services.AddKeyedSingleton("keyed-service-1", TestKeyedService.Create("value-1")); 49builder.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 (22)
Hosting\WebAssemblyHostBuilder.cs (22)
74Logging = new LoggingBuilder(Services); 104return Services.BuildServiceProvider(options); 187Services.AddSingleton<IWebAssemblyHostEnvironment>(hostEnvironment); 283var container = factory.CreateBuilder(Services); 307Services.AddSingleton<IConfiguration>(Configuration); 320Services.AddSingleton<IJSRuntime>(DefaultWebAssemblyJSRuntime.Instance); 321Services.AddSingleton<NavigationManager>(WebAssemblyNavigationManager.Instance); 322Services.AddSingleton<INavigationInterception>(WebAssemblyNavigationInterception.Instance); 323Services.AddSingleton<IScrollToLocationHash>(WebAssemblyScrollToLocationHash.Instance); 324Services.AddSingleton(_jsMethods); 325Services.AddSingleton(new LazyAssemblyLoader(DefaultWebAssemblyJSRuntime.Instance)); 326Services.AddSingleton(_ => _rootComponentCache ?? new()); 327Services.AddSingleton<ComponentStatePersistenceManager>(); 328Services.AddSingleton(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State); 329Services.AddSupplyValueFromPersistentComponentStateProvider(); 330Services.AddSingleton<IErrorBoundaryLogger, WebAssemblyErrorBoundaryLogger>(); 331Services.AddSingleton<ResourceCollectionProvider>(); 332RegisterPersistentComponentStateServiceCollectionExtensions.AddPersistentServiceRegistration<ResourceCollectionProvider>(Services, RenderMode.InteractiveWebAssembly); 333Services.AddLogging(builder => 337Services.AddSingleton<AntiforgeryStateProvider, DefaultAntiforgeryStateProvider>(); 338RegisterPersistentComponentStateServiceCollectionExtensions.AddPersistentServiceRegistration<AntiforgeryStateProvider>(Services, RenderMode.InteractiveWebAssembly); 339Services.AddSupplyValueFromQueryProvider();
Microsoft.AspNetCore.Components.WebAssembly.Tests (16)
Hosting\WebAssemblyHostBuilderTest.cs (12)
42builder.Services.AddScoped<StringBuilder>(); 57builder.Services.AddScoped<StringBuilder>(); 75builder.Services.AddScoped<StringBuilder>(); 98builder.Services.AddScoped<StringBuilder>(); 99builder.Services.AddSingleton<TestServiceThatTakesStringBuilder>(); 112builder.Services.AddScoped<StringBuilder>(); 113builder.Services.AddSingleton<TestServiceThatTakesStringBuilder>(); 227Assert.Single(builder.Services, d => d.ServiceType == type); 256builder.Services.AddScoped<CircularServiceA>(); 257builder.Services.AddScoped<CircularServiceB>(); 295builder.Services.AddScoped<CircularServiceA>(); 296builder.Services.AddScoped<CircularServiceB>();
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>();