Пример #1
0
        public new static HttpResource From(string value, bool strict = true)
        {
            var parts = value.Split(QuerySeparator);

            if (parts.Length == 1)
            {
                return(new HttpResource(LinkPath.From(parts[0], _pathSeparators), HttpQuery.Empty));
            }
            else
            {
                var path  = LinkPath.From(parts[0], _pathSeparators);
                var query = HttpQuery.From(parts[1], strict);

                if (query != null)
                {
                    return(new HttpResource(path, query));
                }
            }

            ExpectNot(strict, "Failed to parse resource: " + value);

            return(null);
        }
Пример #2
0
        public static HttpResource From(LinkPath path, string query, bool strict = true)
        {
            var parsedQuery = HttpQuery.From(query, strict);

            return(parsedQuery == null ? null : new HttpResource(path, parsedQuery));
        }
Пример #3
0
        //
        // Factory
        //

        public static HttpResource From(LinkPath path, HttpQuery query)
        {
            return(new HttpResource(path, query));
        }
Пример #4
0
 private HttpResource(LinkPath path, HttpQuery query)
 {
     Path  = path;
     Query = query;
 }
Пример #5
0
 public static HttpResource From(string path, HttpQuery query)
 {
     return(new HttpResource(LinkPath.From(path, _pathSeparators), query));
 }