2 instantiations of ServiceProviderEngineScope
Microsoft.Extensions.DependencyInjection (2)
ServiceProvider.cs (2)
55
Root = new
ServiceProviderEngineScope
(this, isRootScope: true);
244
return new
ServiceProviderEngineScope
(this, isRootScope: false);
51 references to ServiceProviderEngineScope
Microsoft.Extensions.DependencyInjection (51)
ServiceLookup\CallSiteRuntimeResolver.cs (4)
22
public object? Resolve(ServiceCallSite callSite,
ServiceProviderEngineScope
scope)
82
ServiceProviderEngineScope
serviceProviderEngine = context.Scope.RootProvider.Root;
112
private object? VisitCache(ServiceCallSite callSite, RuntimeResolverContext context,
ServiceProviderEngineScope
serviceProviderEngine, RuntimeResolverLock lockType)
194
public
ServiceProviderEngineScope
Scope { get; set; }
ServiceLookup\CompiledServiceProviderEngine.cs (1)
23
public override Func<
ServiceProviderEngineScope
, object?> RealizeService(ServiceCallSite callSite) => ResolverBuilder.Build(callSite);
ServiceLookup\DynamicServiceProviderEngine.cs (1)
21
public override Func<
ServiceProviderEngineScope
, object?> RealizeService(ServiceCallSite callSite)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (18)
17
private static readonly ParameterExpression ScopeParameter = Expression.Parameter(typeof(
ServiceProviderEngineScope
));
25
typeof(
ServiceProviderEngineScope
).GetProperty(nameof(
ServiceProviderEngineScope
.ResolvedServices), BindingFlags.Instance | BindingFlags.NonPublic)!));
31
typeof(
ServiceProviderEngineScope
).GetProperty(nameof(
ServiceProviderEngineScope
.Sync), BindingFlags.Instance | BindingFlags.NonPublic)!));
43
private readonly
ServiceProviderEngineScope
_rootScope;
45
private readonly ConcurrentDictionary<ServiceCacheKey, Func<
ServiceProviderEngineScope
, object>> _scopeResolverCache;
47
private readonly Func<ServiceCacheKey, ServiceCallSite, Func<
ServiceProviderEngineScope
, object>> _buildTypeDelegate;
52
_scopeResolverCache = new ConcurrentDictionary<ServiceCacheKey, Func<
ServiceProviderEngineScope
, object>>();
56
public Func<
ServiceProviderEngineScope
, object> Build(ServiceCallSite callSite)
71
public Func<
ServiceProviderEngineScope
, object> BuildNoCache(ServiceCallSite callSite)
73
Expression<Func<
ServiceProviderEngineScope
, object>> expression = BuildExpression(callSite);
78
private Expression<Func<
ServiceProviderEngineScope
, object>> BuildExpression(ServiceCallSite callSite)
82
return Expression.Lambda<Func<
ServiceProviderEngineScope
, object>>(
91
return Expression.Lambda<Func<
ServiceProviderEngineScope
, object>>(
209
Func<
ServiceProviderEngineScope
, object> lambda = Build(callSite);
283
typeof(
ServiceProviderEngineScope
)
284
.GetProperty(nameof(
ServiceProviderEngineScope
.IsRootScope), BindingFlags.Instance | BindingFlags.Public)!),
ServiceLookup\Expressions\ExpressionsServiceProviderEngine.cs (1)
18
public override Func<
ServiceProviderEngineScope
, object> RealizeService(ServiceCallSite callSite)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (12)
18
private static readonly MethodInfo ResolvedServicesGetter = typeof(
ServiceProviderEngineScope
).GetProperty(
19
nameof(
ServiceProviderEngineScope
.ResolvedServices), BindingFlags.Instance | BindingFlags.NonPublic)!.GetMethod!;
21
private static readonly MethodInfo ScopeLockGetter = typeof(
ServiceProviderEngineScope
).GetProperty(
22
nameof(
ServiceProviderEngineScope
.Sync), BindingFlags.Instance | BindingFlags.NonPublic)!.GetMethod!;
24
private static readonly MethodInfo ScopeIsRootScope = typeof(
ServiceProviderEngineScope
).GetProperty(
25
nameof(
ServiceProviderEngineScope
.IsRootScope), BindingFlags.Instance | BindingFlags.Public)!.GetMethod!;
47
public Func<
ServiceProviderEngineScope
, object?> Lambda;
53
private readonly
ServiceProviderEngineScope
_rootScope;
66
public Func<
ServiceProviderEngineScope
, object?> Build(ServiceCallSite callSite)
93
parameterTypes: new[] { typeof(ILEmitResolverBuilderRuntimeContext), typeof(
ServiceProviderEngineScope
) },
128
Lambda = (Func<
ServiceProviderEngineScope
, object?>)dynamicMethod.CreateDelegate(typeof(Func<
ServiceProviderEngineScope
, object?>), runtimeContext),
ServiceLookup\ILEmit\ILEmitServiceProviderEngine.cs (1)
19
public override Func<
ServiceProviderEngineScope
, object?> RealizeService(ServiceCallSite callSite)
ServiceLookup\RuntimeServiceProviderEngine.cs (1)
15
public override Func<
ServiceProviderEngineScope
, object?> RealizeService(ServiceCallSite callSite)
ServiceLookup\ServiceLookupHelpers.cs (2)
20
internal static readonly MethodInfo CaptureDisposableMethodInfo = typeof(
ServiceProviderEngineScope
)
21
.GetMethod(nameof(
ServiceProviderEngineScope
.CaptureDisposable), LookupFlags)!;
ServiceLookup\ServiceProviderEngine.cs (1)
10
public abstract Func<
ServiceProviderEngineScope
, object?> RealizeService(ServiceCallSite callSite);
ServiceLookup\ServiceProviderEngineScope.cs (2)
248
private readonly
ServiceProviderEngineScope
_serviceProvider;
250
public ServiceProviderEngineScopeDebugView(
ServiceProviderEngineScope
serviceProvider)
ServiceProvider.cs (7)
35
internal
ServiceProviderEngineScope
Root { get; }
114
internal object? GetKeyedService(Type serviceType, object? serviceKey,
ServiceProviderEngineScope
serviceProviderEngineScope)
127
internal object GetRequiredKeyedService(Type serviceType, object? serviceKey,
ServiceProviderEngineScope
serviceProviderEngineScope)
172
internal object? GetService(ServiceIdentifier serviceIdentifier,
ServiceProviderEngineScope
serviceProviderEngineScope)
222
Func<
ServiceProviderEngineScope
, object?> realizedService = _engine.RealizeService(callSite);
228
internal void ReplaceServiceAccessor(ServiceCallSite callSite, Func<
ServiceProviderEngineScope
, object?> accessor)
291
public Func<
ServiceProviderEngineScope
, object?>? RealizedService { get; set; }