Example #1
0
        public ActionResult <Hero> GetById(string id)
        {
            var hero = _heroService.Get(id);

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

            return(hero);
        }
Example #2
0
 public ActionResult <List <Hero> > Get()
 {
     return(_heroService.Get());
 }
Example #3
0
 public async Task <IActionResult> Get()
 => Ok(await _heroService.Get());
Example #4
0
 public ActionResult <List <Hero> > Get(string name = null)
 {
     return(_heroService.Get(name));
 }