19 references to AddScoped
Aspire.Microsoft.Data.SqlClient (1)
AspireSqlServerSqlClientExtensions.cs (1)
78builder.Services.AddScoped(_ => new SqlConnection(GetConnectionString()));
HostedBlazorWebassemblyApp.Client (1)
Program.cs (1)
24builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
Microsoft.AspNetCore.Components (3)
CascadingValueServiceCollectionExtensions.cs (3)
24=> serviceCollection.AddScoped<ICascadingValueSupplier>(sp => new CascadingValueSource<TValue>(() => initialValueFactory(sp), isFixed: true)); 37=> serviceCollection.AddScoped<ICascadingValueSupplier>(sp => new CascadingValueSource<TValue>(name, () => initialValueFactory(sp), isFixed: true)); 53=> serviceCollection.AddScoped<ICascadingValueSupplier>(sourceFactory);
Microsoft.AspNetCore.Components.Web.Tests (1)
HtmlRendering\HtmlRendererTest.cs (1)
1128})).AddScoped<NavigationManager>(_ => new TestNavigationManager(baseUrl, currentUrl)));
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Latency\ChecpointAcceptanceTests.cs (1)
30.AddScoped(p => p.GetRequiredService<ILatencyContextProvider>().CreateContext())));
Microsoft.AspNetCore.HeaderParsing (2)
HeaderParsingServiceCollectionExtensions.cs (2)
32.AddScoped(provider => provider.GetRequiredService<ObjectPool<HeaderParsingFeature.PoolHelper>>().Get()) 33.AddScoped(provider => provider.GetRequiredService<HeaderParsingFeature.PoolHelper>().Feature)
Microsoft.AspNetCore.Mvc.Core.Test (1)
Routing\DynamicControllerEndpointMatcherPolicyTest.cs (1)
229RequestServices = new ServiceCollection().AddScoped(sp => new CustomTransformer { State = "Invalid" }).BuildServiceProvider(),
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\DynamicPageEndpointMatcherPolicyTest.cs (1)
290RequestServices = new ServiceCollection().AddScoped(sp => new CustomTransformer() { State = "Invalid" }).BuildServiceProvider()
Microsoft.AspNetCore.Mvc.TagHelpers.Test (3)
ComponentTagHelperTest.cs (2)
88.AddScoped(_ => Mock.Of<IDataProtectionProvider>( 92.AddScoped(_ => navManager.Object)
PersistComponentStateTagHelperTest.cs (1)
260.AddScoped(_ => Mock.Of<IDataProtectionProvider>(
Microsoft.Extensions.ObjectPool.DependencyInjection.Tests (2)
DependencyInjectionExtensionsTests.cs (2)
227.AddScoped<ITestClass>(provider => provider.GetRequiredService<Pooled<TestClass>>().Object) 319.AddScoped<ITestClass>(provider => provider.GetRequiredService<Pooled<TestClass>>().Object)
Microsoft.ML.AutoML (3)
AutoMLExperiment\AutoMLExperiment.cs (3)
80_serviceCollection.AddScoped<IStopTrainingManager>((provider) => 95_serviceCollection.AddScoped<IStopTrainingManager>((provider) => 217_serviceCollection.AddScoped((serviceProvider) =>