7 instantiations of ServiceCacheKey
Microsoft.Extensions.DependencyInjection (7)
ServiceLookup\CallSiteFactory.cs (5)
163
_callSiteCache.TryGetValue(new
ServiceCacheKey
(serviceIdentifier, DefaultSlot), out ServiceCallSite? site) ? site :
255
ServiceCacheKey callSiteKey = new
ServiceCacheKey
(serviceIdentifier, DefaultSlot);
374
ServiceCacheKey callSiteKey = new
ServiceCacheKey
(serviceIdentifier, slot);
422
ServiceCacheKey callSiteKey = new
ServiceCacheKey
(serviceIdentifier, slot);
649
_callSiteCache[new
ServiceCacheKey
(serviceIdentifier, DefaultSlot)] = serviceCallSite;
ServiceLookup\ResultCache.cs (2)
13
var cacheKey = new
ServiceCacheKey
(ServiceIdentifier.FromServiceType(serviceType), 0);
40
Key = new
ServiceCacheKey
(serviceIdentifier, slot);
32 references to ServiceCacheKey
Microsoft.Extensions.DependencyInjection (32)
ServiceLookup\CallSiteFactory.cs (5)
18
private readonly ConcurrentDictionary<
ServiceCacheKey
, ServiceCallSite> _callSiteCache = new ConcurrentDictionary<
ServiceCacheKey
, ServiceCallSite>();
255
ServiceCacheKey
callSiteKey = new ServiceCacheKey(serviceIdentifier, DefaultSlot);
374
ServiceCacheKey
callSiteKey = new ServiceCacheKey(serviceIdentifier, slot);
422
ServiceCacheKey
callSiteKey = new ServiceCacheKey(serviceIdentifier, slot);
ServiceLookup\CallSiteRuntimeResolver.cs (1)
116
Dictionary<
ServiceCacheKey
, object?> resolvedServices = serviceProviderEngine.ResolvedServices;
ServiceLookup\CallSiteValidator.cs (2)
13
private readonly ConcurrentDictionary<
ServiceCacheKey
, Type?> _scopedServices = new ConcurrentDictionary<
ServiceCacheKey
, Type?>();
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (5)
19
private static readonly ParameterExpression ResolvedServices = Expression.Variable(typeof(IDictionary<
ServiceCacheKey
, object>), ScopeParameter.Name + "resolvedServices");
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>>();
231
typeof(
ServiceCacheKey
));
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (7)
37
private static readonly ConstructorInfo CacheKeyCtor = typeof(
ServiceCacheKey
).GetConstructors()[0];
55
private readonly ConcurrentDictionary<
ServiceCacheKey
, GeneratedMethod> _scopeResolverCache;
57
private readonly Func<
ServiceCacheKey
, ServiceCallSite, GeneratedMethod> _buildTypeDelegate;
62
_scopeResolverCache = new ConcurrentDictionary<
ServiceCacheKey
, GeneratedMethod>();
277
private static void AddCacheKey(ILEmitResolverBuilderContext argument,
ServiceCacheKey
key)
328
LocalBuilder cacheKeyLocal = context.Generator.DeclareLocal(typeof(
ServiceCacheKey
));
329
LocalBuilder resolvedServicesLocal = context.Generator.DeclareLocal(typeof(IDictionary<
ServiceCacheKey
, object>));
ServiceLookup\ResultCache.cs (3)
13
var
cacheKey = new ServiceCacheKey(ServiceIdentifier.FromServiceType(serviceType), 0);
17
internal ResultCache(CallSiteResultCacheLocation lifetime,
ServiceCacheKey
cacheKey)
45
public
ServiceCacheKey
Key { get; set; }
ServiceLookup\ServiceCacheKey.cs (3)
9
internal readonly struct ServiceCacheKey : IEquatable<
ServiceCacheKey
>
44
public bool Equals(
ServiceCacheKey
other) =>
48
obj is
ServiceCacheKey
other && Equals(other);
ServiceLookup\ServiceLookupHelpers.cs (4)
23
internal static readonly MethodInfo TryGetValueMethodInfo = typeof(IDictionary<
ServiceCacheKey
, object>)
24
.GetMethod(nameof(IDictionary<
ServiceCacheKey
, object>.TryGetValue), LookupFlags)!;
29
internal static readonly MethodInfo AddMethodInfo = typeof(IDictionary<
ServiceCacheKey
, object>)
30
.GetMethod(nameof(IDictionary<
ServiceCacheKey
, object>.Add), LookupFlags)!;
ServiceLookup\ServiceProviderEngineScope.cs (2)
25
ResolvedServices = new Dictionary<
ServiceCacheKey
, object?>();
30
internal Dictionary<
ServiceCacheKey
, object?> ResolvedServices { get; }