Esempio n. 1
0
        public static string GetUrlPath(ActionEnum action)
        {
            string filter = "Controller";
            var    desc   = action.ToEnumDiscription();

            if (desc.Contains(filter))
            {
                desc = desc.Replace(filter, "");
            }
            return(string.Format("{0}/{1}/{2}", AppSettingsConfig.WebApiUrl, desc, action));
        }
Esempio n. 2
0
        /// <summary>
        /// 获取请求API的URL路径
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        public static string GetRequestApiUrlPath(this ActionEnum action)
        {
            string filter = "Controller";
            var    desc   = action.ToEnumDiscription();

            if (desc.Contains(filter))
            {
                desc = desc.Replace(filter, "");
            }
            filter = " ";
            if (desc.Contains(filter))
            {
                desc = desc.Replace(filter, "");
            }
            return(string.Format("{0}/{1}/{2}", ConfigurationSettings.AppSettings["WebApiUrl"].ToString().Trim(), desc.Trim(), action.ToString().Trim()));
        }