示例#1
0
        /// <summary>
        /// 获取请求参数。
        /// </summary>
        /// <param name="context">处理上下文。</param>
        /// <exception cref="ArgumentNullException"><paramref name="context"/> 为 null。</exception>
        /// <returns>请求参数。</returns>
        public static IDictionary <string, string> GetRequestParameters(this IHandlerContext context)
        {
            var parameters = context
                             .NotNull(nameof(context))
                             .Get <IDictionary <string, string> >("Rabbit.WeiXin.RequestParameters");

            if (parameters != null)
            {
                return(parameters);
            }
            parameters = new Dictionary <string, string>();
            context.SetRequestParameters(parameters);
            return(parameters);
        }