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); }
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(); }
public bool Delete(int id) { return(anuncioRepository.Delete(id)); }
public void Delete(int id) { _repository.Delete(id); }
public void Delete(int id) { var anuncio = _anuncioRepository.GetById(id); _anuncioRepository.Delete(anuncio); }
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()); }
public void Delete(long Id) { _anuncioRepository.Delete(Id); }