private ActionDescriptor[] LazilyFetchCanonicalActionsCollection()
 {
     return(DescriptorUtil.LazilyFetchOrCreateDescriptors <MethodInfo, ActionDescriptor>(
                ref _canonicalActionsCache /* cacheLocation */,
                GetAllActionMethodsFromSelector /* initializer */,
                methodInfo => ReflectedActionDescriptor.TryCreateDescriptor(methodInfo, methodInfo.Name, this) /* converter */));
 }
Example #2
0
 private static ParameterDescriptor[] LazilyFetchParametersCollection(ActionDescriptor actionDescriptor, MethodInfo methodInfo, ref ParameterDescriptor[] parametersCache)
 {
     return(DescriptorUtil.LazilyFetchOrCreateDescriptors <ParameterInfo, ParameterDescriptor>(
                cacheLocation: ref parametersCache,
                initializer: methodInfo.GetParameters,
                converter: parameterInfo => new ReflectedParameterDescriptor(parameterInfo, actionDescriptor)));
 }
 private ParameterDescriptor[] LazilyFetchParametersCollection()
 {
     return(DescriptorUtil.LazilyFetchOrCreateDescriptors <ParameterInfo, ParameterDescriptor>(
                ref _parametersCache /* cacheLocation */,
                MethodInfo.GetParameters /* initializer */,
                parameterInfo => new ReflectedParameterDescriptor(parameterInfo, this) /* converter */));
 }
 private ActionDescriptor[] LazilyFetchCanonicalActionsCollection()
 {
     return(DescriptorUtil.LazilyFetchOrCreateDescriptors(
                cacheLocation: ref _canonicalActionsCache,
                initializer: (ReflectedControllerDescriptor state) => state.GetAllActionMethodsFromSelector(),
                converter: (MethodInfo methodInfo, ReflectedControllerDescriptor state) => ReflectedActionDescriptor.TryCreateDescriptor(methodInfo, methodInfo.Name, state),
                state: this));
 }
 private static ParameterDescriptor[] LazilyFetchParametersCollection(ActionDescriptor actionDescriptor, MethodInfo methodInfo, ref ParameterDescriptor[] parametersCache)
 {
     // Frequently called, so ensure the delegates remain static
     return(DescriptorUtil.LazilyFetchOrCreateDescriptors(
                cacheLocation: ref parametersCache,
                initializer: (CreateDescriptorState state) => state.MethodInfo.GetParameters(),
                converter: (ParameterInfo parameterInfo, CreateDescriptorState state) => new ReflectedParameterDescriptor(parameterInfo, state.ActionDescriptor),
                state: new CreateDescriptorState()
     {
         ActionDescriptor = actionDescriptor, MethodInfo = methodInfo
     }));
 }