public IActionResult Alterar([FromBody] Carta model) { if (ModelState.IsValid) { try { _cartaRepository.Alterar(model); } catch (Exception e) { return(NotFound(e.Message)); } return(Ok(_cartaRepository.GetCartaById(model.Id))); } return(BadRequest()); }
private Carta AlterarCarta(Carta carta) { _cartaRepository.Alterar(carta); return(carta); }