Example #1
0
        public IActionResult Post([FromBody] AlunoCadastroViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            try
            {
                appService.Cadastrar(model);
                return(Ok($"Aluno '{model.Nome}', cadastrado com sucesso."));
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }
        }