Exemple #1
0
 public IQueryable <PlanetDto> Get(ODataQueryOptions opts)
 {
     try
     {
         return(_planetService.GetPlanets(opts));
     }
     catch (Exception e)
     {
         log.Info(e.Message);
         return(null);
     }
 }
Exemple #2
0
        public async Task <PlanetViewModel> MapFromApi()
        {
            var planetList = await _planetService.GetPlanets();

            var planets = new List <PlanetsResponse>();

            foreach (var planet in planetList /*.results*/)
            {
                var planetName = new PlanetsResponse();
                planetName.Name = planet.name;
                planetName.Url  = planet.url;
                planets.Add(planetName);
            }

            var planetNameViewModel = new PlanetViewModel();

            planetNameViewModel.ListOfPlanets = planets;

            return(planetNameViewModel);
        }