Ejemplo n.º 1
0
 public TransferStudentActionTests()
 {
     mediatorSpy          = new MediatorSpy();
     mediatorSpy.Response = Result.Ok <object>();
     controller           = new CoursesController(mediatorSpy);
     request = new TransferStudentRequest();
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> Transfer(
            [FromRoute] Guid studentId,
            [FromBody] TransferStudentRequest request)
        {
            var command = new TransferStudentCommand(studentId, request.FromCourseId, request.ToCourseId, request.Grade);
            var result  = await mediator.Send(command);

            return(FromPresenter(new TransferStudentPresenter(result)));
        }