public static bool TryFrom(string value, out HttpResource resource) { var parts = value.Split(QuerySeparator); var path = LinkPath.From(parts[0], _pathSeparators); if (parts.Length == 1) { resource = new HttpResource(path, HttpQuery.Empty); } else if (HttpQuery.TryFrom(parts[1], out var parsedQuery)) { resource = new HttpResource(path, parsedQuery); } else { resource = null; } return(resource != null); }
public static bool TryFrom(LinkPath path, string query, out HttpResource resource) { resource = HttpQuery.TryFrom(query, out var parsedQuery) ? new HttpResource(path, parsedQuery) : null; return(resource != null); }
HttpResource(LinkPath path, HttpQuery query) { Path = path; Query = query; }
public static HttpResource From(string path, string query) => From(path, HttpQuery.From(query));
public static HttpResource From(string path, HttpQuery query) => new HttpResource(LinkPath.From(path, _pathSeparators), query);
public static HttpResource From(LinkPath path, string query) => new HttpResource(path, HttpQuery.From(query));
public static HttpResource From(LinkPath path, HttpQuery query) => new HttpResource(path, query);