Exemple #1
0
        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());
        }
Exemple #2
0
 private Carta AlterarCarta(Carta carta)
 {
     _cartaRepository.Alterar(carta);
     return(carta);
 }