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 }); }
public override string ToString() { return(UrlUtils.JoinPaths(BaseAddress ?? string.Empty, Path) + UrlUtils.FormatQueryString(QueryParameters) + UrlUtils.FormatFragment(Fragment)); }