Ejemplo n.º 1
0
        public static string GetUrl(string pluginId, string routeResource = "", string routeId = "", string routeAction = "")
        {
            var apiUrl = ApiManager.GetApiUrl(Route);

            apiUrl = apiUrl.Replace("{pluginId}", pluginId);
            if (!string.IsNullOrEmpty(routeResource))
            {
                apiUrl = PageUtils.Combine(apiUrl, routeResource);
                if (!string.IsNullOrEmpty(routeId))
                {
                    apiUrl = PageUtils.Combine(apiUrl, routeId);
                    if (!string.IsNullOrEmpty(routeAction))
                    {
                        apiUrl = PageUtils.Combine(apiUrl, "actions", routeAction);
                    }
                }
                else if (!string.IsNullOrEmpty(routeAction))
                {
                    apiUrl = PageUtils.Combine(apiUrl, "actions", routeAction);
                }
            }
            else if (!string.IsNullOrEmpty(routeAction))
            {
                apiUrl = PageUtils.Combine(apiUrl, "actions", routeAction);
            }
            return(apiUrl);
        }
Ejemplo n.º 2
0
        public static string GetUrl(string pluginId, string name = "", string id = "")
        {
            var apiUrl = ApiManager.GetApiUrl(Route);

            apiUrl = apiUrl.Replace("{pluginId}", pluginId);
            if (!string.IsNullOrEmpty(name))
            {
                apiUrl = PageUtils.Combine(apiUrl, name);
                if (!string.IsNullOrEmpty(id))
                {
                    apiUrl = PageUtils.Combine(apiUrl, id);
                }
            }
            return(apiUrl);
        }