Esempio n. 1
0
        public string[] GetHeroes()
        {
            List <Hero> heroes = _heroesRepository.GetHeroes();

            string[] heroNames = null;

            if (heroes != null && heroes.Count > 0)
            {
                heroNames = new string[heroes.Count];
                for (int i = 0; i < heroes.Count; i++)
                {
                    heroNames[i] = heroes[i].Name;
                }
            }
            return(heroNames);
        }
Esempio n. 2
0
        public IActionResult GetHeroes(int id)
        {
            var responseData = _heroesRepository.GetHeroes(id);

            return(Json(new { response = responseData, code = 1 }));
        }
Esempio n. 3
0
 public IEnumerable <Hero> Get()
 {
     return(_heroRepository.GetHeroes());
 }