Beispiel #1
0
        protected virtual MethodInfo GetInvokeMethod(Type serviceType, RequestMappingBaseAttribute requestMapping, Type returnType, bool async)
        {
            MethodInfo httpClientMethod;
            bool       isGeneric = !(returnType == null || returnType == typeof(void) || returnType == typeof(Task));

            if (isGeneric)
            {
                httpClientMethod = async ? FeignClientHttpProxy <object> .GetHttpSendAsyncGenericMethod(serviceType) : FeignClientHttpProxy <object> .GetHttpSendGenericMethod(serviceType);
            }
            else
            {
                httpClientMethod = async ? FeignClientHttpProxy <object> .GetHttpSendAsyncMethod(serviceType) : FeignClientHttpProxy <object> .GetHttpSendMethod(serviceType);
            }
            if (isGeneric)
            {
                return(httpClientMethod.MakeGenericMethod(returnType));
            }
            return(httpClientMethod);
        }