2 instantiations of ParameterBindingMethodCache
Microsoft.AspNetCore.OpenApi (2)
src\Shared\ParameterBindingMethodCache.cs (2)
30
private static readonly Lazy<ParameterBindingMethodCache> _instance = new(() => new
ParameterBindingMethodCache
());
32
private static readonly Lazy<ParameterBindingMethodCache> _nonThrowingInstance = new(() => new
ParameterBindingMethodCache
(throwOnInvalidMethod: false));
14 references to ParameterBindingMethodCache
Microsoft.AspNetCore.OpenApi (14)
Services\OpenApiGenerator.cs (5)
260
var parameters = PropertyAsParameterInfo.Flatten(methodInfo.GetParameters(),
ParameterBindingMethodCache
.Instance);
362
var parameters = PropertyAsParameterInfo.Flatten(methodInfo.GetParameters(),
ParameterBindingMethodCache
.Instance);
429
ParameterBindingMethodCache
.Instance.HasBindAsyncMethod(parameter) ||
434
else if (parameter.ParameterType == typeof(string) ||
ParameterBindingMethodCache
.Instance.HasTryParseMethod(parameter.ParameterType))
453
(parameter.ParameterType.IsArray &&
ParameterBindingMethodCache
.Instance.HasTryParseMethod(parameter.ParameterType.GetElementType()!))))
src\Shared\ParameterBindingMethodCache.cs (8)
15
using static Microsoft.AspNetCore.Http.
ParameterBindingMethodCache
.SharedExpressions;
24
private static readonly MethodInfo ConvertValueTaskMethod = typeof(
ParameterBindingMethodCache
).GetMethod(nameof(ConvertValueTask), BindingFlags.NonPublic | BindingFlags.Static)!;
25
private static readonly MethodInfo ConvertValueTaskOfNullableResultMethod = typeof(
ParameterBindingMethodCache
).GetMethod(nameof(ConvertValueTaskOfNullableResult), BindingFlags.NonPublic | BindingFlags.Static)!;
26
private static readonly MethodInfo BindAsyncMethod = typeof(
ParameterBindingMethodCache
).GetMethod(nameof(BindAsync), BindingFlags.NonPublic | BindingFlags.Static)!;
30
private static readonly Lazy<
ParameterBindingMethodCache
> _instance = new(() => new ParameterBindingMethodCache());
31
public static
ParameterBindingMethodCache
Instance = _instance.Value;
32
private static readonly Lazy<
ParameterBindingMethodCache
> _nonThrowingInstance = new(() => new ParameterBindingMethodCache(throwOnInvalidMethod: false));
33
public static
ParameterBindingMethodCache
NonThrowingInstance = _nonThrowingInstance.Value;
src\Shared\PropertyAsParameterInfo.cs (1)
64
public static ReadOnlySpan<ParameterInfo> Flatten(ParameterInfo[] parameters,
ParameterBindingMethodCache
cache)