Exemplo n.º 1
0
        public static CreatedStudentCommandRequest MapToCommand(this CriarAlunoModel model)
        {
            var entity = new People(model.Cpf, model.Nome, model.Email, PeopleType.Student);

            entity.AddUser(new User(model.Login, model.senha));
            entity.AddStudent(new Domain.Entities.Student(model.Ra));
            var result = new CreatedStudentCommandRequest(entity);

            return(result);
        }
Exemplo n.º 2
0
 public async Task <IActionResult> Aluno([FromForm] CriarAlunoModel model)
 {
     return(Ok(_mediator.Send(model.MapToCommand())));
 }