1 write to ServiceKey
Microsoft.Extensions.DependencyInjection (1)
ServiceLookup\ServiceIdentifier.cs (1)
22ServiceKey = serviceKey;
28 references to ServiceKey
Microsoft.Extensions.DependencyInjection (28)
ServiceLookup\CallSiteFactory.cs (16)
216if (serviceIdentifier.ServiceKey != null) 239if (serviceIdentifier.ServiceKey != null) 274var cacheKey = new ServiceIdentifier(serviceIdentifier.ServiceKey, itemType); 285bool isAnyKeyLookup = serviceIdentifier.ServiceKey == KeyedService.AnyKey; 323if (KeysMatch(cacheKey.ServiceKey, _descriptors[i].ServiceKey)) 340if (KeysMatch(cacheKey.ServiceKey, _descriptors[i].ServiceKey)) 415return _callSiteCache[callSiteKey] = new IEnumerableCallSite(resultCache, itemType, callSites, serviceIdentifier.ServiceKey); 487callSite = new FactoryCallSite(lifetime, descriptor.ServiceType, serviceIdentifier.ServiceKey!, descriptor.KeyedImplementationFactory); 583return new ConstructorCallSite(lifetime, serviceIdentifier.ServiceType, constructor, serviceIdentifier.ServiceKey); 593return new ConstructorCallSite(lifetime, serviceIdentifier.ServiceType, constructor, parameterCallSites, serviceIdentifier.ServiceKey); 657return new ConstructorCallSite(lifetime, serviceIdentifier.ServiceType, bestConstructor, parameterCallSites, serviceIdentifier.ServiceKey); 683if (serviceIdentifier.ServiceKey != null && attribute is ServiceKeyAttribute) 687if (serviceIdentifier.ServiceKey == KeyedService.AnyKey) 691else if (parameterType != serviceIdentifier.ServiceKey.GetType() 697callSite = new ConstantCallSite(parameterType, serviceIdentifier.ServiceKey); 783if (serviceIdentifier.ServiceKey != null && _descriptorLookup.ContainsKey(new ServiceIdentifier(KeyedService.AnyKey, serviceType)))
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (1)
282AddConstant(argument, id.ServiceKey);
ServiceLookup\ServiceIdentifier.cs (11)
33if (ServiceKey == null && other.ServiceKey == null) 37else if (ServiceKey != null && other.ServiceKey != null) 39return ServiceType == other.ServiceType && ServiceKey.Equals(other.ServiceKey); 51if (ServiceKey == null) 57return (ServiceType.GetHashCode() * 397) ^ ServiceKey.GetHashCode(); 61public ServiceIdentifier GetGenericTypeDefinition() => new ServiceIdentifier(ServiceKey, ServiceType.GetGenericTypeDefinition()); 65if (ServiceKey == null) 70return $"({ServiceKey}, {ServiceType})";