public ActionResult Put([FromBody] OngDTO ongDTO)
        {
            try
            {
                if (ongDTO == null)
                {
                    return(NotFound(new { message = "Ong inválida!" }));
                }

                _applicationServiceOng.Update(ongDTO);
                return(Ok("Ong Atualizado com sucesso!"));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Banco de dados Falhou - método PUT"));
            }
        }
Пример #2
0
        public void Remove(OngDTO obj)
        {
            var objEntity = _mapper.Map <Ong>(obj);

            _serviceOng.Remove(objEntity);
        }
Пример #3
0
        public void Update(OngDTO obj)
        {
            var objEntity = _mapper.Map <Ong>(obj);

            _serviceOng.Update(objEntity);
        }
Пример #4
0
        public void Add(OngDTO obj)
        {
            var objEntity = _mapper.Map <Ong>(obj);

            _serviceOng.Add(objEntity);
        }