예제 #1
0
        public async Task <string> StartScoring(Guid examId, CancellationToken cancellationToken)
        {
            var command = new StartScoringCommand(examId);
            var result  = await _commandBus.PublishAsync(command, cancellationToken);

            return(result.ExamId);
        }
예제 #2
0
        public async Task <IActionResult> ExamScoringStart([FromBody] ExamScoringStartRequest request, CancellationToken cancellationToken)
        {
            var command = new StartScoringCommand(request.ExamId);

            var result = await _commandBus.PublishAsync(command, cancellationToken);

            return(result.IsSuccess ? Ok() : StatusCode(500));
        }