Esempio n. 1
0
        public async Task <IEnumerable <Person> > GetMany()
        {
            using (var handler = new PersonsHttpClientHandler())
            {
                var persons = await handler.GetManyAsync();

                return(persons);
            }
        }
Esempio n. 2
0
        public async Task <Person> GetById(string id)
        {
            using (var handler = new PersonsHttpClientHandler())
            {
                var person = await handler.GetByIdAsync(id);

                if (person == null)
                {
                    throw new HttpResponseException(HttpStatusCode.NotFound);
                }
                return(person);
            }
        }