.net core —— 生成url

时间:2020-12-04 14:41:12   收藏:0   阅读:36
            var urlBuild = new UriBuilder()
            {
                Scheme = this.Request.Scheme,
                Host = this.Request.Host.Host,
                Path = this.Request.PathBase + "/Orders/Detail"
            };
            if (Request.Host.Port != null)
            {
                urlBuild.Port = Request.Host.Port.Value;
            }
            urlBuild.Query = $"orderNumber={item.OrderNumber}";
            tempItem.DetailUrl = urlBuild.Uri.AbsoluteUri;

  

原文:https://www.cnblogs.com/panpanwelcome/p/14085198.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!