Exemplo n.º 1
0
        public ActionResult <UserModel> Put([FromRoute] Guid id, [FromBody] UserModel model)
        {
            if (model == null || id != model.Id)
            {
                return(BadRequest());
            }

            var user = FilterUserById(id);

            if (user == null)
            {
                return(NotFound());
            }

            user.Name  = model.Name;
            user.Email = model.Email;
            user.Phone = model.Phone;

            var result = _userMock.Atualizar(user);

            return(Ok(result));
        }