Пример #1
0
        public void GetPlanet()
        {
            Console.WriteLine("Get Planet Test:");

            DomainServiceRepository repo = new DomainServiceRepository();

            Console.WriteLine(repo.GetPlanetByName("Earth").Name + "\n");
        }
Пример #2
0
        public IActionResult Get(string name)
        {
            PlanetModel planet = repo.GetPlanetByName(name);

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

            return(Ok(jconv.Convert(planet)));
        }
Пример #3
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));
        }