1 write to Services
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHostBuilder.cs (1)
78
Services
= new ServiceCollection();
50 references to Services
Microsoft.AspNetCore.Components.WebAssembly (23)
Hosting\WebAssemblyHostBuilder.cs (23)
79
Logging = new LoggingBuilder(
Services
);
109
return
Services
.BuildServiceProvider(options);
192
Services
.AddSingleton<IWebAssemblyHostEnvironment>(hostEnvironment);
288
var container = factory.CreateBuilder(
Services
);
312
Services
.AddSingleton<IConfiguration>(Configuration);
327
Services
.AddSingleton<IJSRuntime>(DefaultWebAssemblyJSRuntime.Instance);
328
Services
.AddSingleton<NavigationManager>(WebAssemblyNavigationManager.Instance);
329
Services
.AddSingleton<INavigationInterception>(WebAssemblyNavigationInterception.Instance);
330
Services
.AddSingleton<IScrollToLocationHash>(WebAssemblyScrollToLocationHash.Instance);
331
Services
.AddSingleton(_jsMethods);
332
Services
.AddSingleton(new LazyAssemblyLoader(DefaultWebAssemblyJSRuntime.Instance));
333
Services
.AddSingleton(_ => _rootComponentCache ?? new());
334
Services
.AddSingleton<ComponentStatePersistenceManager>();
335
Services
.AddSingleton(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State);
336
Services
.AddSupplyValueFromPersistentComponentStateProvider();
337
Services
.AddSingleton<IErrorBoundaryLogger, WebAssemblyErrorBoundaryLogger>();
338
Services
.AddSingleton<ResourceCollectionProvider>();
339
RegisterPersistentComponentStateServiceCollectionExtensions.AddPersistentServiceRegistration<ResourceCollectionProvider>(
Services
, RenderMode.InteractiveWebAssembly);
340
Services
.AddLogging(builder =>
344
Services
.AddSingleton<AntiforgeryStateProvider, DefaultAntiforgeryStateProvider>();
345
RegisterPersistentComponentStateServiceCollectionExtensions.AddPersistentServiceRegistration<AntiforgeryStateProvider>(
Services
, RenderMode.InteractiveWebAssembly);
346
Services
.AddSupplyValueFromQueryProvider();
347
Services
.AddSingleton<HostedServiceExecutor>();
Microsoft.AspNetCore.Components.WebAssembly.Tests (27)
Hosting\WebAssemblyHostBuilderTest.cs (12)
42
builder.
Services
.AddScoped<StringBuilder>();
57
builder.
Services
.AddScoped<StringBuilder>();
75
builder.
Services
.AddScoped<StringBuilder>();
98
builder.
Services
.AddScoped<StringBuilder>();
99
builder.
Services
.AddSingleton<TestServiceThatTakesStringBuilder>();
112
builder.
Services
.AddScoped<StringBuilder>();
113
builder.
Services
.AddSingleton<TestServiceThatTakesStringBuilder>();
227
Assert.Single(builder.
Services
, d => d.ServiceType == type);
256
builder.
Services
.AddScoped<CircularServiceA>();
257
builder.
Services
.AddScoped<CircularServiceB>();
295
builder.
Services
.AddScoped<CircularServiceA>();
296
builder.
Services
.AddScoped<CircularServiceB>();
Hosting\WebAssemblyHostTest.cs (15)
23
builder.
Services
.AddSingleton(Mock.Of<IJSRuntime>());
43
builder.
Services
.AddSingleton(Mock.Of<IJSRuntime>());
65
builder.
Services
.AddSingleton(Mock.Of<IJSRuntime>());
66
builder.
Services
.AddSingleton<DisposableService>();
92
builder.
Services
.AddSingleton(Mock.Of<IJSRuntime>());
95
builder.
Services
.AddSingleton<IHostedService>(testHostedService);
120
builder.
Services
.AddSingleton(Mock.Of<IJSRuntime>());
124
builder.
Services
.AddSingleton<IHostedService>(testHostedService1);
125
builder.
Services
.AddSingleton<IHostedService>(testHostedService2);
153
builder.
Services
.AddSingleton(Mock.Of<IJSRuntime>());
157
builder.
Services
.AddSingleton<IHostedService>(goodService);
158
builder.
Services
.AddSingleton<IHostedService>(faultyService);
185
builder.
Services
.AddSingleton(Mock.Of<IJSRuntime>());
188
builder.
Services
.AddSingleton<TestHostedService>();
189
builder.
Services
.AddSingleton<IHostedService>(serviceProvider => serviceProvider.GetRequiredService<TestHostedService>());