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

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

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