Exemplo n.º 1
0
        public async Task <IActionResult> Editar(AmigoViewModel amigoViewModel)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View(amigoViewModel));
                }

                await _amigoService.Edit(amigoViewModel);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception)
            {
                TratarErro();
            }

            return(View());
        }