示例#1
0
        public IEnumerable <Domain.Entities.StarShip> GetAll()
        {
            var response = httpRestClient.Get(resource);

            var responseContent = HttpRestClientHelper.GetResultStreamAsString(response);

            var starShips = jsonSerializer.Deserialize <IEnumerable <Domain.Entities.StarShip> >(responseContent);

            return(starShips);
        }
示例#2
0
        public Domain.Entities.StarLogPage GetStarshipsByPage(int?page = 1)
        {
            var param = $"?page={page}";

            var response = httpRestClient.Get(resource, param);

            var responseContent = HttpRestClientHelper.GetResultStreamAsString(response);

            var starlogPage = jsonSerializer.Deserialize <Domain.Entities.StarLogPage>(responseContent);

            return(starlogPage);
        }