public ActionResult <Hero> Create(Hero hero)
 {
     return(_heroService.Create(hero));
 }
Beispiel #2
0
        public ActionResult <Hero> Create([FromBody] Hero hero)
        {
            Hero createdHero = _heroService.Create(hero);

            return(CreatedAtRoute("GetHero", new { id = hero.Id }, createdHero));
        }
Beispiel #3
0
        public async Task <IActionResult> Create([FromBody] Hero hero)
        {
            await _heroService.Create(hero);

            return(CreatedAtRoute("GetHero", new { id = hero.Id.ToString() }, hero));
        }
        public ActionResult <Hero> Create(Hero hero)
        {
            _heroService.Create(hero);

            return(CreatedAtRoute("GetHero", new { id = hero.Id.ToString() }, hero));
        }