Пример #1
0
        /// <summary>
        /// Queries resources of type <see cref="T"/> using the provided criteria, in the form of key/value pairs
        /// </summary>
        /// <param name="resourceDescriptor"></param>
        /// <returns></returns>
        public virtual async Task <IEnumerable <T> > Query <T>(ResourceDescriptor resourceDescriptor) where T : Resource, new()
        {
            var resp = await HttpClient.GetAsync(resourceDescriptor.Url);

            resp.EnsureSuccessStatusCode();

            return(await ResourceSerializer.DeserializeResponseBodyToResourceCollection <T>(resp));
        }