15 references to TryAddScoped
Microsoft.AspNetCore.Components.Endpoints (4)
DependencyInjection\RazorComponentsServiceCollectionExtensions.cs (4)
60services.TryAddScoped<IComponentPrerenderer>(services => services.GetRequiredService<EndpointHtmlRenderer>()); 66services.TryAddScoped(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State); 71services.TryAddScoped<IRoutingStateProvider>(sp => sp.GetRequiredService<EndpointRoutingStateProvider>()); 105services.TryAddScoped(sp => (EndpointAntiforgeryStateProvider)sp.GetRequiredService<AntiforgeryStateProvider>());
Microsoft.AspNetCore.Components.Server (3)
DependencyInjection\ComponentServiceCollectionExtensions.cs (3)
44services.TryAddScoped(static services => new ProtectedLocalStorage( 48services.TryAddScoped(static services => new ProtectedSessionStorage( 87services.TryAddScoped(s => s.GetRequiredService<ICircuitAccessor>().Circuit);
Microsoft.AspNetCore.Components.WebAssembly.Authentication (2)
WebAssemblyAuthenticationServiceCollectionExtensions.cs (2)
67services.TryAddScoped(sp => 83services.TryAddScoped(static sp => (IRemoteAuthenticationService<TRemoteAuthenticationState>)sp.GetRequiredService<AuthenticationStateProvider>());
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
WebAssemblyRazorComponentsBuilderExtensions.cs (1)
35builder.Services.TryAddScoped(static sp =>
Microsoft.AspNetCore.Components.WebView (1)
ComponentsWebViewServiceCollectionExtensions.cs (1)
33services.TryAddScoped<PersistentComponentState>(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State);
Microsoft.AspNetCore.Diagnostics.Middleware (1)
..\..\..\..\src\Libraries\Microsoft.AspNetCore.Diagnostics.Middleware\Latency\RequestLatencyTelemetryServiceCollectionExtensions.cs (1)
40services.TryAddScoped(p => p.GetRequiredService<ILatencyContextProvider>().CreateContext());
Microsoft.Maui (3)
Hosting\Animations\AppHostBuilderExtensions.cs (2)
19 builder.Services.TryAddScoped<ITicker>(svcs => new PlatformTicker()); 21 builder.Services.TryAddScoped<IAnimationManager>(svcs => new AnimationManager(svcs.GetRequiredService<ITicker>()));
Hosting\Dispatching\AppHostBuilderExtensions.cs (1)
25 builder.Services.TryAddScoped<IDispatcher>((svc) => GetDispatcher(svc, true));