Example #1
0
        public IActionResult Get(string name)
        {
            PlanetModel planet = repo.GetPlanetByName(name);

            if (planet == null)
            {
                return(NotFound());
            }

            return(Ok(jconv.Convert(planet)));
        }
Example #2
0
        public IActionResult Get(string name)
        {
            SolarSystemModel solarSystem = repo.GetSolarSystemByName(name);

            if (solarSystem == null)
            {
                return(NotFound());
            }

            return(Ok(jconv.Convert(solarSystem)));
        }
Example #3
0
        public IActionResult Get(string name)
        {
            StarModel star = repo.GetStarByName(name);

            if (star == null)
            {
                return(NotFound());
            }

            return(Ok(jconv.Convert(star)));
        }
Example #4
0
        public IActionResult Get(string name)
        {
            ConstellationModel constellation = repo.GetConstellationByName(name);

            if (constellation == null)
            {
                return(NotFound());
            }

            return(Ok(jconv.Convert(constellation)));
        }
Example #5
0
        public void PlanetConvert()
        {
            Console.WriteLine("Planet Convert Test:");

            PlanetModel bigDipper = repo.GetPlanetByName("Neptune");

            List <ConstellationModel> constellations = repo.GetAllConstellations();

            JSONConvert jconv = new JSONConvert();

            Console.WriteLine(jconv.Convert(bigDipper));

            Console.WriteLine(jconv.Convert(constellations));
        }
Example #6
0
        public void ConstellationConvert()
        {
            Console.WriteLine("Constellation Convert Test:");

            ConstellationModel bigDipper = repo.GetConstellationByName("Ursa Major");

            List <ConstellationModel> constellations = repo.GetAllConstellations();

            JSONConvert jconv = new JSONConvert();

            Console.WriteLine(jconv.Convert(bigDipper));

            Console.WriteLine(jconv.Convert(constellations));
        }
Example #7
0
        public void StarConvert()
        {
            Console.WriteLine("JSON Star Convert Test");

            JSONConvert jconv = new JSONConvert();

            StarModel star = repo.GetStarByName("Dubhe");

            List <StarModel> stars = repo.GetAllStars();

            Console.WriteLine(jconv.Convert(star));

            Console.WriteLine(jconv.Convert(stars));
        }