5 types derived from ServiceCallSite
Microsoft.Extensions.DependencyInjection (5)
ServiceLookup\ConstantCallSite.cs (1)
8
internal sealed class ConstantCallSite :
ServiceCallSite
ServiceLookup\ConstructorCallSite.cs (1)
9
internal sealed class ConstructorCallSite :
ServiceCallSite
ServiceLookup\FactoryCallSite.cs (1)
8
internal sealed class FactoryCallSite :
ServiceCallSite
ServiceLookup\IEnumerableCallSite.cs (1)
11
internal sealed class IEnumerableCallSite :
ServiceCallSite
ServiceLookup\ServiceProviderCallSite.cs (1)
8
internal sealed class ServiceProviderCallSite :
ServiceCallSite
93 references to ServiceCallSite
Microsoft.Extensions.DependencyInjection (93)
CallSiteJsonFormatter.cs (8)
18
public string Format(
ServiceCallSite
callSite)
21
var context = new CallSiteFormatterContext(stringBuilder, 0, new HashSet<
ServiceCallSite
>());
37
foreach (
ServiceCallSite
parameter in constructorCallSite.ParameterCallSites)
48
protected override object? VisitCallSiteMain(
ServiceCallSite
callSite, CallSiteFormatterContext argument)
94
foreach (
ServiceCallSite
item in enumerableCallSite.ServiceCallSites)
113
private readonly HashSet<
ServiceCallSite
> _processedCallSites;
115
public CallSiteFormatterContext(StringBuilder builder, int offset, HashSet<
ServiceCallSite
> processedCallSites)
128
public bool ShouldFormat(
ServiceCallSite
serviceCallSite)
DependencyInjectionEventSource.cs (1)
106
public void CallSiteBuilt(ServiceProvider provider, Type serviceType,
ServiceCallSite
callSite)
ServiceLookup\CallSiteFactory.cs (28)
18
private readonly ConcurrentDictionary<ServiceCacheKey,
ServiceCallSite
> _callSiteCache = new ConcurrentDictionary<ServiceCacheKey,
ServiceCallSite
>();
162
internal
ServiceCallSite
? GetCallSite(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain) =>
163
_callSiteCache.TryGetValue(new ServiceCacheKey(serviceIdentifier, DefaultSlot), out
ServiceCallSite
? site) ? site :
166
internal
ServiceCallSite
? GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain)
178
private
ServiceCallSite
? CreateCallSite(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
201
ServiceCallSite
? callSite = TryCreateExact(serviceIdentifier, callSiteChain) ??
209
private
ServiceCallSite
? TryCreateExact(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
229
private
ServiceCallSite
? TryCreateOpenGeneric(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
253
private
ServiceCallSite
? TryCreateEnumerable(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
256
if (_callSiteCache.TryGetValue(callSiteKey, out
ServiceCallSite
? serviceCallSite))
283
ServiceCallSite
[] callSites;
292
callSites = new
ServiceCallSite
[descriptors.Count];
300
ServiceCallSite
? callSite = TryCreateExact(descriptor, cacheKey, callSiteChain, slot);
315
List<KeyValuePair<int,
ServiceCallSite
>> callSitesByIndex = new();
340
callSites = new
ServiceCallSite
[callSitesByIndex.Count];
346
void AddCallSite(
ServiceCallSite
callSite, int index)
370
private
ServiceCallSite
? TryCreateExact(ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot)
375
if (_callSiteCache.TryGetValue(callSiteKey, out
ServiceCallSite
? serviceCallSite))
380
ServiceCallSite
callSite;
417
private
ServiceCallSite
? TryCreateOpenGeneric(ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, int slot, bool throwOnConstraintViolation)
423
if (_callSiteCache.TryGetValue(callSiteKey, out
ServiceCallSite
? serviceCallSite))
469
ServiceCallSite
[]? parameterCallSites = null;
503
ServiceCallSite
[]? currentParameterCallSites = CreateArgumentCallSites(
565
private
ServiceCallSite
[]? CreateArgumentCallSites(
572
var parameterCallSites = new
ServiceCallSite
[parameters.Length];
576
ServiceCallSite
? callSite = null;
647
public void Add(ServiceIdentifier serviceIdentifier,
ServiceCallSite
serviceCallSite)
ServiceLookup\CallSiteRuntimeResolver.cs (5)
22
public object? Resolve(
ServiceCallSite
callSite, ServiceProviderEngineScope scope)
36
protected override object? VisitDisposeCache(
ServiceCallSite
transientCallSite, RuntimeResolverContext context)
73
protected override object? VisitRootCache(
ServiceCallSite
callSite, RuntimeResolverContext context)
103
protected override object? VisitScopeCache(
ServiceCallSite
callSite, RuntimeResolverContext context)
112
private object? VisitCache(
ServiceCallSite
callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
ServiceLookup\CallSiteValidator.cs (8)
15
public void ValidateCallSite(
ServiceCallSite
callSite) => VisitCallSite(callSite, default);
17
public void ValidateResolution(
ServiceCallSite
callSite, IServiceScope scope, IServiceScope rootScope)
39
protected override Type? VisitCallSite(
ServiceCallSite
callSite, CallSiteValidatorState argument)
70
foreach (
ServiceCallSite
parameterCallSite in constructorCallSite.ParameterCallSites)
82
foreach (
ServiceCallSite
serviceCallSite in enumerableCallSite.ServiceCallSites)
90
protected override Type? VisitRootCache(
ServiceCallSite
singletonCallSite, CallSiteValidatorState state)
96
protected override Type? VisitScopeCache(
ServiceCallSite
scopedCallSite, CallSiteValidatorState state)
117
public
ServiceCallSite
? Singleton { get; set; }
ServiceLookup\CallSiteVisitor.cs (6)
17
protected virtual TResult VisitCallSite(
ServiceCallSite
callSite, TArgument argument)
39
protected virtual TResult VisitCallSiteMain(
ServiceCallSite
callSite, TArgument argument)
58
protected virtual TResult VisitNoCache(
ServiceCallSite
callSite, TArgument argument)
63
protected virtual TResult VisitDisposeCache(
ServiceCallSite
callSite, TArgument argument)
68
protected virtual TResult VisitRootCache(
ServiceCallSite
callSite, TArgument argument)
73
protected virtual TResult VisitScopeCache(
ServiceCallSite
callSite, TArgument argument)
ServiceLookup\CompiledServiceProviderEngine.cs (1)
23
public override Func<ServiceProviderEngineScope, object?> RealizeService(
ServiceCallSite
callSite) => ResolverBuilder.Build(callSite);
ServiceLookup\ConstructorCallSite.cs (3)
12
internal
ServiceCallSite
[] ParameterCallSites { get; }
14
public ConstructorCallSite(ResultCache cache, Type serviceType, ConstructorInfo constructorInfo) : this(cache, serviceType, constructorInfo, Array.Empty<
ServiceCallSite
>())
18
public ConstructorCallSite(ResultCache cache, Type serviceType, ConstructorInfo constructorInfo,
ServiceCallSite
[] parameterCallSites) : base(cache)
ServiceLookup\DynamicServiceProviderEngine.cs (1)
21
public override Func<ServiceProviderEngineScope, object?> RealizeService(
ServiceCallSite
callSite)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (10)
47
private readonly Func<ServiceCacheKey,
ServiceCallSite
, Func<ServiceProviderEngineScope, object>> _buildTypeDelegate;
56
public Func<ServiceProviderEngineScope, object> Build(
ServiceCallSite
callSite)
71
public Func<ServiceProviderEngineScope, object> BuildNoCache(
ServiceCallSite
callSite)
78
private Expression<Func<ServiceProviderEngineScope, object>> BuildExpression(
ServiceCallSite
callSite)
96
protected override Expression VisitRootCache(
ServiceCallSite
singletonCallSite, object? context)
151
protected override Expression VisitDisposeCache(
ServiceCallSite
callSite, object? context)
160
private static Expression TryCaptureDisposable(
ServiceCallSite
callSite, ParameterExpression scope, Expression service)
207
protected override Expression VisitScopeCache(
ServiceCallSite
callSite, object? context)
214
private ConditionalExpression BuildScopedExpression(
ServiceCallSite
callSite)
218
typeof(
ServiceCallSite
));
ServiceLookup\Expressions\ExpressionsServiceProviderEngine.cs (1)
18
public override Func<ServiceProviderEngineScope, object> RealizeService(
ServiceCallSite
callSite)
ServiceLookup\IEnumerableCallSite.cs (2)
14
internal
ServiceCallSite
[] ServiceCallSites { get; }
16
public IEnumerableCallSite(ResultCache cache, Type itemType,
ServiceCallSite
[] serviceCallSites) : base(cache)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (10)
57
private readonly Func<ServiceCacheKey,
ServiceCallSite
, GeneratedMethod> _buildTypeDelegate;
66
public Func<ServiceProviderEngineScope, object?> Build(
ServiceCallSite
callSite)
71
private GeneratedMethod BuildType(
ServiceCallSite
callSite)
86
private GeneratedMethod BuildTypeNoCache(
ServiceCallSite
callSite)
135
protected override object? VisitDisposeCache(
ServiceCallSite
transientCallSite, ILEmitResolverBuilderContext argument)
153
foreach (
ServiceCallSite
parameterCallSite in constructorCallSite.ParameterCallSites)
171
protected override object? VisitRootCache(
ServiceCallSite
callSite, ILEmitResolverBuilderContext argument)
177
protected override object? VisitScopeCache(
ServiceCallSite
scopedCallSite, ILEmitResolverBuilderContext argument)
231
ServiceCallSite
parameterCallSite = enumerableCallSite.ServiceCallSites[i];
289
private ILEmitResolverBuilderRuntimeContext GenerateMethodBody(
ServiceCallSite
callSite, ILGenerator generator)
ServiceLookup\ILEmit\ILEmitServiceProviderEngine.cs (1)
19
public override Func<ServiceProviderEngineScope, object?> RealizeService(
ServiceCallSite
callSite)
ServiceLookup\RuntimeServiceProviderEngine.cs (1)
15
public override Func<ServiceProviderEngineScope, object?> RealizeService(
ServiceCallSite
callSite)
ServiceLookup\ServiceProviderEngine.cs (1)
10
public abstract Func<ServiceProviderEngineScope, object?> RealizeService(
ServiceCallSite
callSite);
ServiceProvider.cs (6)
159
private void OnCreate(
ServiceCallSite
callSite)
164
private void OnResolve(
ServiceCallSite
? callSite, IServiceScope scope)
195
ServiceCallSite
? callSite = CallSiteFactory.GetCallSite(descriptor, new CallSiteChain());
209
ServiceCallSite
? callSite = CallSiteFactory.GetCallSite(serviceIdentifier, new CallSiteChain());
228
internal void ReplaceServiceAccessor(
ServiceCallSite
callSite, Func<ServiceProviderEngineScope, object?> accessor)
290
public
ServiceCallSite
? CallSite { get; set; }