Ejemplo n.º 1
0
        /// <summary>
        /// Retrieve a list of Owners along with their Pets.
        /// </summary>
        /// <returns>IList<Owner></returns>
        public async Task <IList <T> > GetAll()
        {
            try
            {
                // 1. Get Full URL (with EndPoint)
                string httpUrl = _urlHelper.GetFullEndpointUrl(_endpoint);

                // 2. Retrieve text from URL
                string text = await _httpClient.Get(httpUrl);

                // 3. Deserialize text JSON into Owners list
                IList <T> owners = _deserializer.DeserializeText(text);

                return(owners);
            }
            catch (Exception ex)
            {
                new LoggerAGL().Log(LoggingEventType.Error, ex.Message);
                throw ex;
            }
        }