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