Ejemplo n.º 1
0
        async Task <IViewQueryResult> QueryInternal(ViewQuery query)
        {
            var response = await StartQuery(uriConstructor.GetQueryUri(query));

            if (!response.IsSuccessStatusCode)
            {
                var error = new CouchError(parent.Settings.Serializer, response);
                error.ThrowDatabaseMissingExceptionIfNedded(uriConstructor);
                error.ThrowViewNotFoundExceptionIfNedded(query);
                error.ThrowCouchCommunicationException();
            }
            using (var reader = await response.Content.ReadAsUtf8TextReaderAsync())
                return(ViewQueryResultParser.Parse(reader, query));
        }
Ejemplo n.º 2
0
		 async Task<IViewQueryResult> QueryInternal(ViewQuery query)
		{
			var response = await StartQuery(uriConstructor.GetQueryUri(query));
			if (!response.IsSuccessStatusCode)
			{
				var error = new CouchError(parent.Settings.Serializer, response);
				error.ThrowDatabaseMissingExceptionIfNedded(uriConstructor);
				error.ThrowViewNotFoundExceptionIfNedded(query);
				error.ThrowCouchCommunicationException();
			}
			using (var reader = await response.Content.ReadAsUtf8TextReaderAsync())
				return ViewQueryResultParser.Parse(reader, query);
		}