Exemplo n.º 1
0
        public async Task <IActionResult> GetById(int id)
        {
            var aluno = await _repository.GetAlunoByIdAsync(id, false);

            if (aluno == null)
            {
                return(NotFound("Aluno não encontrado!"));
            }

            var alunoDto = _mapper.Map <AlunoRegistrarDto>(aluno);

            return(Ok(alunoDto));
        }
Exemplo n.º 2
0
 public async Task <AlunoEditModel> GetAlunoAsync(int alunoId)
 => mapper.Map(await alunoRepository.GetAlunoByIdAsync(alunoId), new AlunoEditModel());