Beispiel #1
0
        public bool Delete(int id)
        {
            var anuncio = GetById(id);

            if (_anuncioRepository.Delete(anuncio) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public ResponseBase Delete(int id)
        {
            var response = new ResponseBase();

            try
            {
                _anuncioRepository.Delete(id);
                _anuncioRepository.SaveChanges();
            }
            catch (Exception ex)
            {
                response.Success   = false;
                response.Message   = $"{ex.Message}";
                response.Exception = ex;
            }

            return(response);
        }
Beispiel #3
0
        public async Task Execute(RemoverAnuncioInput removerAnuncioInput)
        {
            if (removerAnuncioInput.Id == 0)
            {
                _outputHandler.NotFound($"Codigo do anuncio inválido.");
                return;
            }

            var anuncio = await _anuncioRepository.Get(removerAnuncioInput.Id);

            if (anuncio == null)
            {
                _outputHandler.NotFound($"Anuncio não encontrado.");
                return;
            }

            await _anuncioRepository.Delete(anuncio);

            _outputHandler.Default();
        }
Beispiel #4
0
 public bool Delete(int id)
 {
     return(anuncioRepository.Delete(id));
 }
 public void Delete(int id)
 {
     _repository.Delete(id);
 }
Beispiel #6
0
        public void Delete(int id)
        {
            var anuncio = _anuncioRepository.GetById(id);

            _anuncioRepository.Delete(anuncio);
        }
Beispiel #7
0
 public void Delete(long id)
 {
     _repository.Delete(id);
 }
 public void Delete(int id)
 {
     _anuncioRepository.Delete(id);
 }
 public IActionResult Delete(string id, [FromServices] IAnuncioRepository repository)
 {
     repository.Delete(new Guid(id));
     return(Ok());
 }
Beispiel #10
0
 public void Delete(long Id)
 {
     _anuncioRepository.Delete(Id);
 }