2 instantiations of ParameterBindingMethodCache
Microsoft.AspNetCore.Http.Extensions (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));
19 references to ParameterBindingMethodCache
Microsoft.AspNetCore.Http.Extensions (19)
RequestDelegateFactory.cs (10)
90
private static readonly ParameterExpression HttpContextExpr =
ParameterBindingMethodCache
.SharedExpressions.HttpContextExpr;
106
private static readonly ParameterExpression TempSourceStringExpr =
ParameterBindingMethodCache
.SharedExpressions.TempSourceStringExpr;
789
ParameterBindingMethodCache
.Instance.HasTryParseMethod(parameter.ParameterType) ||
790
(parameter.ParameterType.IsArray &&
ParameterBindingMethodCache
.Instance.HasTryParseMethod(parameter.ParameterType.GetElementType()!));
866
else if (
ParameterBindingMethodCache
.Instance.HasBindAsyncMethod(parameter))
871
else if (parameter.ParameterType == typeof(string) ||
ParameterBindingMethodCache
.Instance.HasTryParseMethod(parameter.ParameterType))
901
(parameter.ParameterType.IsArray &&
ParameterBindingMethodCache
.Instance.HasTryParseMethod(parameter.ParameterType.GetElementType()!))))
1571
var (constructor, parameters) =
ParameterBindingMethodCache
.Instance.FindConstructor(parameterType);
1682
var tryParseMethodCall =
ParameterBindingMethodCache
.Instance.FindTryParseMethod(nonNullableParameterType);
1980
var bindAsyncMethod =
ParameterBindingMethodCache
.Instance.FindBindAsyncMethod(parameter);
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)