public ActionResult Post([FromBody] PalestranteEventoDTO model) { try { if (model == null) { return(NotFound(new { message = "PalestranteEvento inválido!" })); } _servicoAplicacaoPalestranteEvento.Adicionar(model); return(Ok("PalestranteEvento adicionado com sucesso!")); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, $"Falha no banco: {e.Message}")); } }
public void Deletar(PalestranteEventoDTO obj) { var objEntity = _mapper.Map <PalestranteEvento>(obj); _servicoPalestranteEvento.Deletar(objEntity); }