Beispiel #1
0
        public ProfessorResponseModel Create(ProfessorRequestModel request)
        {
            ProfessorCommand command   = new ProfessorCommand(request.FirstName, request.LastName);
            Professor        professor = createProfessorHandler.Handle(command);

            ProfessorResponseModel response = professorsMapper.Map(professor);

            return(response);
        }
        public async Task <IActionResult> Professor([FromBody] ProfessorCommand professor)
        {
            var response = await _mediator.Send(professor);

            if (!response)
            {
                return(NotFound());
            }
            return(Ok(response));
        }