示例#1
0
        public IActionResult Delete(Guid id)
        {
            try
            {
                var dica = _dicaRepository.Buscar(id);

                if (dica == null)
                {
                    return(NotFound());
                }

                _dicaRepository.Excluir(id);
                return(Ok(dica));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message + ". Envie um email para a nossa equipe de suporte: [email protected]"));
            }
        }
示例#2
0
        public IActionResult Delete(Guid id)
        {
            try
            {
                var Dica = _dicaRepository.BuscarPorId(id);


                if (Dica == null)
                {
                    return(NotFound());
                }


                _dicaRepository.Excluir(id);

                return(Ok(id));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }