예제 #1
0
        protected virtual Uri CreateActionUri(string relativeUrl, QueryStringParameters parameters = null)
        {
            if (parameters != null)
            {
                var queryString = new QueryString(parameters);
                relativeUrl = queryString.AppendToUrl(relativeUrl);
            }

            // См. http://stackoverflow.com/a/23438417/60188
            relativeUrl = relativeUrl.TrimStart('/');

            var url = new Uri($"{BaseUrl.ToString().TrimEnd('/')}/{relativeUrl}");

            return(url);
        }