public IActionResult Delete(int id) { try { _anuncioBusiness.Delete(id); return(NoContent()); } catch (Exception ex) { return(BadRequest(ex.ToString())); } }
public IActionResult Delete(int id) { var retono = _business.FindById(id); if (retono == null) { return(NotFound()); } try { _business.Delete(id); return(NoContent()); } catch (Exception ex) { return(BadRequest(ex.ToString())); } }
public ActionResult <Usuario> DeleteAnuncio(Guid id) { var anuncioExiste = AnuncioExists(id); if (!anuncioExiste) { return(NotFound()); } try { _anuncioBusiness.Delete(id); _unitOfWork.Commit(); return(Ok(id)); } catch (Exception ex) { _unitOfWork.Rollback(); return(Conflict(ex.Message)); } }
public IActionResult DeletarAnuncio(int id) { _anuncioBusiness.Delete(id); return(NoContent()); }