public async Task <IActionResult> Add(CreateStudentEnrollment command) { if (!ModelState.IsValid) { return(BadRequest()); } var enrollment = await _studiesService.EnrollStudent(command.IndexNumber, command.FirstName, command.LastName, command.BirthDate, command.Studies); return(Created("", enrollment.ToViewModel())); }
public async Task <IActionResult> EnrollStudent(CreateStudentEnrollment createStudentEnrollment) => Created("", await _mediator.Send(createStudentEnrollment));