Esempio n. 1
0
        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}"));
            }
        }
Esempio n. 2
0
        public void Deletar(PalestranteEventoDTO obj)
        {
            var objEntity = _mapper.Map <PalestranteEvento>(obj);

            _servicoPalestranteEvento.Deletar(objEntity);
        }