public IQueryable <PlanetDto> Get(ODataQueryOptions opts) { try { return(_planetService.GetPlanets(opts)); } catch (Exception e) { log.Info(e.Message); return(null); } }
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); }