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