/// <summary> /// Combines path to root to generate a URI. /// </summary> /// <param name="path">The relative path.</param> /// <param name="query">The optional query data.</param> /// <returns>A URI.</returns> public Uri GetUri(string path, QueryData query = null) { if (string.IsNullOrWhiteSpace(path)) { return(CoreResources.GetUri(RelativePath, query)); } if (string.IsNullOrWhiteSpace(RelativePath)) { return(CoreResources.GetUri(path, query)); } if (path.Contains("://")) { if (query != null) { path = query.ToString(path); } return(new Uri(path)); } var a = RelativePath + (RelativePath.EndsWith('/') ? string.Empty : "/"); var b = path[0] == '/' ? path.Range(0, -1) : path; return(CoreResources.GetUri(a + b, query)); }
/// <summary> /// Combines path to root to generate a URI. /// </summary> /// <param name="query">The optional query data.</param> /// <returns>A URI.</returns> public Uri GetUri(QueryData query = null) => CoreResources.GetUri(RelativePath, query);