public async Task <IActionResult> Post(NoticiaDto model) { try { var noticia = _mapper.Map <Noticia>(model); _repo.Add(noticia); if (await _repo.SaveChangesAsync()) { return(Created($"/api/noticia/{model.Id}", _mapper.Map <NoticiaDto>(noticia))); } } catch (Exception) { return(this.StatusCode(StatusCodes.Status500InternalServerError, "Falha ao inserir Dados")); } return(BadRequest()); }