38 references to ImplementationFactory
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
80
if (oldDbContextOptionsDescriptor.
ImplementationFactory
?.Invoke(sp) is not DbContextOptions<TContext> dbContextOptions)
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
564
{
ImplementationFactory
: { } factory } => ServiceDescriptor.KeyedSingleton<IHost>(this, (sp, _) => (IHost)factory(sp)),
Aspire.Hosting.Tests (2)
DistributedApplicationTests.cs (2)
579
Assert.Single(lifecycleHookDescriptors, sd => sd.
ImplementationFactory
== callback1);
580
Assert.DoesNotContain(lifecycleHookDescriptors, sd => sd.
ImplementationFactory
== callback2);
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
80
if (oldDbContextOptionsDescriptor.
ImplementationFactory
?.Invoke(sp) is not DbContextOptions<TContext> dbContextOptions)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
80
if (oldDbContextOptionsDescriptor.
ImplementationFactory
?.Invoke(sp) is not DbContextOptions<TContext> dbContextOptions)
Aspire.MongoDB.EntityFrameworkCore (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
80
if (oldDbContextOptionsDescriptor.
ImplementationFactory
?.Invoke(sp) is not DbContextOptions<TContext> dbContextOptions)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
80
if (oldDbContextOptionsDescriptor.
ImplementationFactory
?.Invoke(sp) is not DbContextOptions<TContext> dbContextOptions)
Aspire.Oracle.EntityFrameworkCore (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
80
if (oldDbContextOptionsDescriptor.
ImplementationFactory
?.Invoke(sp) is not DbContextOptions<TContext> dbContextOptions)
Aspire.Pomelo.EntityFrameworkCore.MySql (1)
src\Components\Common\EntityFrameworkUtils.cs (1)
80
if (oldDbContextOptionsDescriptor.
ImplementationFactory
?.Invoke(sp) is not DbContextOptions<TContext> dbContextOptions)
Microsoft.Extensions.AI.Tests (12)
ChatCompletion\DependencyInjectionPatterns.cs (4)
129
Assert.NotNull(sd.
ImplementationFactory
);
130
Assert.IsType<TestChatClient>(sd.
ImplementationFactory
(null!));
175
Assert.NotNull(sd.
ImplementationFactory
);
176
Assert.IsType<TestEmbeddingGenerator>(sd.
ImplementationFactory
(null!));
Image\ImageGeneratorDependencyInjectionPatterns.cs (4)
129
Assert.NotNull(sd.
ImplementationFactory
);
130
Assert.IsType<TestImageGenerator>(sd.
ImplementationFactory
(null!));
168
Assert.NotNull(sd.
ImplementationFactory
);
169
Assert.IsType<TestImageGenerator>(sd.
ImplementationFactory
(null!));
SpeechToText\SpeechToTextClientDependencyInjectionPatterns.cs (4)
129
Assert.NotNull(sd.
ImplementationFactory
);
130
Assert.IsType<TestSpeechToTextClient>(sd.
ImplementationFactory
(null!));
168
Assert.NotNull(sd.
ImplementationFactory
);
169
Assert.IsType<TestSpeechToTextClient>(sd.
ImplementationFactory
(null!));
Microsoft.Extensions.DependencyInjection (5)
DependencyInjectionEventSource.cs (2)
273
else if (!descriptor.IsKeyedService && descriptor.
ImplementationFactory
!= null)
276
builder.Append(descriptor.
ImplementationFactory
.Method);
ServiceLookup\CallSiteFactory.cs (2)
491
else if (!descriptor.IsKeyedService && descriptor.
ImplementationFactory
!= null)
493
callSite = new FactoryCallSite(lifetime, descriptor.ServiceType, descriptor.
ImplementationFactory
);
ServiceLookup\ServiceDescriptorExtensions.cs (1)
28
: serviceDescriptor.
ImplementationFactory
;
Microsoft.Extensions.DependencyInjection.Abstractions (8)
ServiceDescriptor.cs (8)
231
/// If <see cref="IsKeyedService"/> is <see langword="false"/>, <see cref="
ImplementationFactory
"/> should be called instead.
289
if (
ImplementationFactory
!= null)
292
DiagnosticMethodInfo? dmi = DiagnosticMethodInfo.Create(
ImplementationFactory
);
301
return lifetime + $"{nameof(
ImplementationFactory
)}: {declaringTypeName}.{methodName}";
320
else if (
ImplementationFactory
!= null)
322
Type[]? typeArguments =
ImplementationFactory
.GetType().GenericTypeArguments;
1064
else if (
ImplementationFactory
!= null)
1066
debugText += $@", ImplementationFactory = {
ImplementationFactory
.Method}";
Microsoft.Maui (3)
Hosting\Internal\MauiFactory.cs (3)
60
if (item.
ImplementationFactory
!= null)
61
return item.
ImplementationFactory
(this);
63
throw new InvalidOperationException($"You need to provide an {nameof(item.ImplementationType)}, an {nameof(item.
ImplementationFactory
)} or an {nameof(item.ImplementationInstance)}.");