Example #1
0
        public IActionResult Get(string name)
        {
            ConstellationModel constellation = repo.GetConstellationByName(name);

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

            return(Ok(jconv.Convert(constellation)));
        }
Example #2
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 #3
0
        public void GetConstellation()
        {
            Console.WriteLine("Get Constellation Test:");

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

            Console.WriteLine("Big Dipper Stars: ");

            foreach (StarModel star in bigDipper.Stars)
            {
                Console.WriteLine(star.Name);
            }

            Console.WriteLine("");
        }