53 references to AddTransient
aspire (2)
Program.cs (2)
500
builder.Services.
AddTransient
<IProcessTreeGracefulShutdownSignaler>(sp => sp.GetRequiredService<ProcessTreeGracefulShutdownService>());
502
builder.Services.
AddTransient
<IAppHostStopper>(sp => sp.GetRequiredService<ProcessTreeGracefulShutdownService>());
Aspire.Cli.Tests (7)
Utils\CliTestHelper.cs (7)
151
services.
AddTransient
(options.ExtensionBackchannelFactory);
159
services.
AddTransient
(options.DotNetCliExecutionFactoryFactory);
160
services.
AddTransient
(options.DotNetCliRunnerFactory);
162
services.
AddTransient
(options.NuGetPackageCacheFactory);
223
services.
AddTransient
<IProcessTreeGracefulShutdownSignaler>(sp => sp.GetRequiredService<ProcessTreeGracefulShutdownService>());
224
services.
AddTransient
<IAppHostStopper>(sp => sp.GetRequiredService<ProcessTreeGracefulShutdownService>());
376
services.
AddTransient
(options.AppHostBackchannelFactory);
Aspire.Hosting.Tests (13)
Pipelines\PipelineOutputDiffingLifetimeTests.cs (4)
39
builder.Services.
AddTransient
<IPipelineOutputSnapshotter<LifetimeSnapshot>>(_ =>
46
builder.Services.
AddTransient
<IPipelineOutputComparer<LifetimeSnapshot>>(_ =>
147
builder.Services.
AddTransient
<IPipelineOutputSnapshotter<LifetimeSnapshot>>(_ =>
153
builder.Services.
AddTransient
<IPipelineOutputComparer<LifetimeSnapshot>>(_ =>
Pipelines\PipelineOutputDiffingTests.cs (8)
307
builder.Services.
AddTransient
<IPipelineOutputSnapshotter<PipelineOutputSnapshot>>(_ => throw new InvalidOperationException("typed snapshotter resolved"));
308
builder.Services.
AddTransient
<IPipelineOutputComparer<PipelineOutputSnapshot>>(_ => throw new InvalidOperationException("comparer resolved"));
366
builder.Services.
AddTransient
<IPipelineOutputSnapshotter<PipelineOutputSnapshot>>(_ => throw new InvalidOperationException("typed snapshotter resolved"));
367
builder.Services.
AddTransient
<IPipelineOutputComparer<PipelineOutputSnapshot>>(_ => throw new InvalidOperationException("comparer resolved"));
737
builder.Services.
AddTransient
<IPipelineOutputSnapshotter<RecordingSnapshot>>(_ =>
779
builder.Services.
AddTransient
<IPipelineOutputSnapshotter<RecordingSnapshot>>(_ =>
785
builder.Services.
AddTransient
<IPipelineOutputComparer<RecordingSnapshot>>(_ =>
976
builder.Services.
AddTransient
<IPipelineOutputSnapshotter<GitSnapshot>>(_ => new GitSnapshotter(workspace.Path));
Pipelines\PipelineOutputResolutionTests.cs (1)
42
builder.Services.
AddTransient
<IPipelineOutputSnapshotter<ContentSnapshot>>(Create);
Microsoft.Extensions.DependencyInjection.Abstractions (1)
Extensions\ServiceCollectionDescriptorExtensions.cs (1)
202
/// <seealso cref="ServiceCollectionServiceExtensions.
AddTransient
{TService}(IServiceCollection, Func{IServiceProvider, TService})"/>
Microsoft.Extensions.Http (5)
DependencyInjection\HttpClientBuilderExtensions.cs (5)
53
builder.Services.
AddTransient
<IConfigureOptions<HttpClientFactoryOptions>>(services =>
375
builder.Services.
AddTransient
(s => AddTransientHelper<TClient>(s, builder));
439
builder.Services.
AddTransient
(s => AddTransientHelper<TClient, TImplementation>(s, builder));
490
builder.Services.
AddTransient
<TClient>(s =>
539
builder.Services.
AddTransient
<TClient>(s =>
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\HttpClientLoggingExtensionsTest.cs (1)
692
serviceCollection.
AddTransient
(_ =>
Microsoft.Extensions.ObjectPool.DependencyInjection.Tests (1)
DependencyInjectionExtensionsTests.cs (1)
262
.
AddTransient
<ITestClass>(provider => provider.GetRequiredService<Pooled<TestClass>>().Object)
Microsoft.Extensions.Options (21)
OptionsBuilder.cs (21)
73
Services.
AddTransient
<IConfigureOptions<TOptions>>(sp =>
94
Services.
AddTransient
<IConfigureOptions<TOptions>>(sp =>
117
Services.
AddTransient
<IConfigureOptions<TOptions>>(
147
Services.
AddTransient
<IConfigureOptions<TOptions>>(
180
Services.
AddTransient
<IConfigureOptions<TOptions>>(
222
Services.
AddTransient
<IPostConfigureOptions<TOptions>>(sp =>
243
Services.
AddTransient
<IPostConfigureOptions<TOptions>>(sp =>
266
Services.
AddTransient
<IPostConfigureOptions<TOptions>>(
296
Services.
AddTransient
<IPostConfigureOptions<TOptions>>(
329
Services.
AddTransient
<IPostConfigureOptions<TOptions>>(
362
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
418
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
449
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
488
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
532
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
581
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
672
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
725
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
783
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
846
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
914
Services.
AddTransient
<IValidateOptions<TOptions>>(sp =>
Microsoft.ML.AutoML (2)
API\AutoMLExperimentExtension.cs (1)
181
experiment.ServiceCollection.
AddTransient
<IPerformanceMonitor>(factory);
AutoMLExperiment\AutoMLExperiment.cs (1)
155
_serviceCollection.
AddTransient
<ITrialRunner>(factory);