public async Task <IActionResult> Post([FromBody] HeroInput input) { var item = await _heroAppService .Insert(input) .ConfigureAwait(false); return(CreatedContent("", item)); }
public IActionResult Post([FromBody] HeroInput input) { try { var item = _heroAppService.Insert(input); return(Created("", item)); } catch (ArgumentException ex) { return(BadRequest($"Erro => {ex.Message}")); } }