예제 #1
0
 private CouchRequest GetRequest(ViewOptions options, string uri)
 {
     if (options != null)
     {
         uri += options.ToString();
     }
     return(GetRequest(uri, options == null ? null : options.Etag).Get().Json());
 }
예제 #2
0
        private CouchRequest GetRequest(ViewOptions options, string uri)
        {
            if (options != null)
            {
                uri += options.ToString();
            }
            CouchRequest request = GetRequest(uri, options == null ? null : options.Etag).Get().Json();

            if (options.isAtKeysSizeLimit)
            {
                // Encode the keys parameter in the request body and turn it into a POST request.
                string keys = "{\"keys\": [" + String.Join(",", options.Keys.Select(k => k.ToRawString()).ToArray()) + "]}";
                request.Post().Data(keys);
            }
            return(request);
        }
예제 #3
0
        public IListResult List(string listName, string viewName, ViewOptions options, string designDoc)
        {
            var uri = databaseBaseUri + "/_design/" + designDoc + "/_list/" + listName + "/" + viewName + options.ToString();
            var req = GetRequest(uri);

            return(new ListResult(req.GetRequest(), req.GetResponse()));
        }
예제 #4
0
        public IListResult List(string listName, string viewName, ViewOptions options, string designDoc)
        {
            var uri = string.Format("{0}/_design/{1}/_list/{2}/{3}{4}", databaseBaseUri, designDoc, listName, viewName, options.ToString());
            var req = GetRequest(uri);

            return(new ListResult(req.GetRequest(), req.GetCouchResponse()));
        }