示例#1
0
 public static UrlInfo Append(this UrlInfo target, UrlInfo appendable)
 {
     return(new UrlInfo
     {
         BaseAddress = target.BaseAddress ?? appendable.BaseAddress,
         Path = UrlUtils.JoinPaths(target.Path, appendable.Path),
         QueryParameters = target.QueryParameters
                           .Union(appendable.QueryParameters)
                           .ToDictionary(x => x.Key, x => x.Value),
         Fragment = appendable.Fragment ?? target.Fragment
     });
 }
示例#2
0
 public override string ToString()
 {
     return(UrlUtils.JoinPaths(BaseAddress ?? string.Empty, Path)
            + UrlUtils.FormatQueryString(QueryParameters)
            + UrlUtils.FormatFragment(Fragment));
 }