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

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

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

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