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); 285var isAnyKeyLookup = serviceIdentifier.ServiceKey == KeyedService.AnyKey; 322if (KeysMatch(cacheKey.ServiceKey, _descriptors[i].ServiceKey)) 335if (KeysMatch(cacheKey.ServiceKey, _descriptors[i].ServiceKey)) 365return _callSiteCache[callSiteKey] = new IEnumerableCallSite(resultCache, itemType, callSites, serviceIdentifier.ServiceKey); 426callSite = new FactoryCallSite(lifetime, descriptor.ServiceType, serviceIdentifier.ServiceKey!, descriptor.KeyedImplementationFactory); 514return new ConstructorCallSite(lifetime, serviceIdentifier.ServiceType, constructor, serviceIdentifier.ServiceKey); 524return new ConstructorCallSite(lifetime, serviceIdentifier.ServiceType, constructor, parameterCallSites, serviceIdentifier.ServiceKey); 588return new ConstructorCallSite(lifetime, serviceIdentifier.ServiceType, bestConstructor, parameterCallSites, serviceIdentifier.ServiceKey); 614if (serviceIdentifier.ServiceKey != null && attribute is ServiceKeyAttribute) 618if (serviceIdentifier.ServiceKey == KeyedService.AnyKey) 622else if (parameterType != serviceIdentifier.ServiceKey.GetType() 628callSite = new ConstantCallSite(parameterType, serviceIdentifier.ServiceKey); 714if (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(); 63public ServiceIdentifier GetGenericTypeDefinition() => new ServiceIdentifier(ServiceKey, ServiceType.GetGenericTypeDefinition()); 67if (ServiceKey == null) 72return $"({ServiceKey}, {ServiceType})";