1 write to ServiceKey
Microsoft.Extensions.DependencyInjection (1)
ServiceLookup\ServiceIdentifier.cs (1)
22
ServiceKey
= serviceKey;
28 references to ServiceKey
Microsoft.Extensions.DependencyInjection (28)
ServiceLookup\CallSiteFactory.cs (16)
216
if (serviceIdentifier.
ServiceKey
!= null)
239
if (serviceIdentifier.
ServiceKey
!= null)
274
var cacheKey = new ServiceIdentifier(serviceIdentifier.
ServiceKey
, itemType);
285
var isAnyKeyLookup = serviceIdentifier.
ServiceKey
== KeyedService.AnyKey;
322
if (KeysMatch(cacheKey.
ServiceKey
, _descriptors[i].ServiceKey))
335
if (KeysMatch(cacheKey.
ServiceKey
, _descriptors[i].ServiceKey))
365
return _callSiteCache[callSiteKey] = new IEnumerableCallSite(resultCache, itemType, callSites, serviceIdentifier.
ServiceKey
);
426
callSite = new FactoryCallSite(lifetime, descriptor.ServiceType, serviceIdentifier.
ServiceKey
!, descriptor.KeyedImplementationFactory);
514
return new ConstructorCallSite(lifetime, serviceIdentifier.ServiceType, constructor, serviceIdentifier.
ServiceKey
);
524
return new ConstructorCallSite(lifetime, serviceIdentifier.ServiceType, constructor, parameterCallSites, serviceIdentifier.
ServiceKey
);
588
return new ConstructorCallSite(lifetime, serviceIdentifier.ServiceType, bestConstructor, parameterCallSites, serviceIdentifier.
ServiceKey
);
614
if (serviceIdentifier.
ServiceKey
!= null && attribute is ServiceKeyAttribute)
618
if (serviceIdentifier.
ServiceKey
== KeyedService.AnyKey)
622
else if (parameterType != serviceIdentifier.
ServiceKey
.GetType()
628
callSite = new ConstantCallSite(parameterType, serviceIdentifier.
ServiceKey
);
714
if (serviceIdentifier.
ServiceKey
!= null && _descriptorLookup.ContainsKey(new ServiceIdentifier(KeyedService.AnyKey, serviceType)))
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (1)
282
AddConstant(argument, id.
ServiceKey
);
ServiceLookup\ServiceIdentifier.cs (11)
33
if (
ServiceKey
== null && other.
ServiceKey
== null)
37
else if (
ServiceKey
!= null && other.
ServiceKey
!= null)
39
return ServiceType == other.ServiceType &&
ServiceKey
.Equals(other.
ServiceKey
);
51
if (
ServiceKey
== null)
57
return (ServiceType.GetHashCode() * 397) ^
ServiceKey
.GetHashCode();
63
public ServiceIdentifier GetGenericTypeDefinition() => new ServiceIdentifier(
ServiceKey
, ServiceType.GetGenericTypeDefinition());
67
if (
ServiceKey
== null)
72
return $"({
ServiceKey
}, {ServiceType})";