Ejemplo n.º 1
0
 IList <ApiParameter> getParameters(IEnumerable <ApiParameterDescription> parameterDescriptions, MethodInfo methodInfo)
 {
     //var parameters = methodInfo.GetParameters();
     return(parameterDescriptions
            .Select(_ => new ApiParameter
     {
         Name = _.ParameterDescriptor.ParameterName,
         Summary = xmlDocmentationReader.GetParameter(methodInfo, _.Name),
         Type = typeRegister.RegisterType(_.ParameterDescriptor.ParameterType),
         //BindInclude = parameters.FirstOrDefault(__ => __.Name == _.Name)?.GetCustomAttribute<Binding>()?.Include?.GetBind(toCamelCase),
         Source = _.Source.ToString(),
         Required = _.ParameterDescriptor.IsOptional == false,
         DefaultValue = _.ParameterDescriptor.DefaultValue,
     })
            .ToList());
 }
Ejemplo n.º 2
0
        IList <ApiParameter> getParameters(IEnumerable <ApiParameterDescription> parameterDescriptions, MethodInfo methodInfo)
        {
            var parameters = methodInfo.GetParameters();

            return(parameterDescriptions
                   .Select(_ => new ApiParameter
            {
                Name = _.Name,
                Summary = xmlDocmentationReader.GetParameter(methodInfo, _.Name) ?? xmlDocmentationReader.GetSummary(_.ModelMetadata?.ContainerType?.GetProperty(_.Name)),
                Type = typeRegister.RegisterType(_.Type),
                BindInclude = parameters.FirstOrDefault(__ => __.Name == _.Name)?.GetCustomAttribute <BindAttribute>()?.Include?.GetBind(toCamelCase),
                Source = _.Source.Id,
                Required = _.ModelMetadata?.IsBindingRequired,
                DefaultValue = _.RouteInfo?.DefaultValue,
            })
                   .ToList());
        }