示例#1
0
        void context_BeginRequest(object sender, EventArgs e)
        {
            var methodFormRouteData = new MethodFormRouteData()
            {
                Form = HttpContext.Current.Request.Path
            };

            if (Router.IsProcess(methodFormRouteData))
            {
                methodFormRouteData.Params = HttpContext.Current.Request.Params;
                var result = Router.Execute(methodFormRouteData);
                WebHelper.ResponseWriteJson(result);
                WebHelper.Response.End();
            }
        }
示例#2
0
        string GetTypeName(MethodFormRouteData methodFormRouteData)
        {
            var match = RegexType.Match(methodFormRouteData.Form);

            if (match.Success == false)
            {
                return(string.Empty);
            }
            var value = match.Groups["Type"].Value;

            if (string.IsNullOrEmpty(this.TypeTemplate))
            {
                return(value);
            }
            return(string.Format(this.TypeTemplate, value));
        }