コード例 #1
0
        /// <summary>
        /// 获取参数
        /// </summary>
        /// <param name="RouteData"></param>
        /// <param name="_objs"></param>
        /// <returns></returns>
        internal static bool GetMinObj(AshxRouteData RouteData, out object[] _objs)
        {
            Ashx ashx = RouteData.GetAshx;

            if (ashx.Parameters.Length > 0)
            {
                bool minObj(out object[] _objs)
                {
                    int index  = 0;
                    int length = ashx.Parameters.Length;

                    _objs = new object[length];
                    if (ashx.Parameters[index].ParameterType == typeof(HttpContext))
                    {
                        _objs[0] = RouteData.HttpContext;
                        index++;
                    }
                    _objs = AshxExtension.GetParameterObjs(ashx, RouteData.HttpContext.Request, index, length, _objs, out bool isException);
                    return(isException);
                }

                return(minObj(out _objs));
            }
            _objs = default;
            return(false);
        }
コード例 #2
0
        /// <summary>
        /// 获取参数
        /// </summary>
        /// <param name="RouteData"></param>
        /// <param name="_objs"></param>
        /// <returns></returns>
        internal static bool GetObj(AshxRouteData RouteData, out object[] _objs)
        {
            Ashx ashx = RouteData.GetAshx;

            if (ashx.Parameters.Length > 0)
            {
                bool obj(out object[] _objs)
                {
                    int length = ashx.Parameters.Length;

                    _objs = new object[length];
                    _objs = AshxExtension.GetParameterObjs(ashx, RouteData.HttpContext.Request, 0, length, _objs, out bool isException);
                    return(isException);
                }

                return(obj(out _objs));
            }
            _objs = default;
            return(false);
        }