public async Task <string> StartScoring(Guid examId, CancellationToken cancellationToken) { var command = new StartScoringCommand(examId); var result = await _commandBus.PublishAsync(command, cancellationToken); return(result.ExamId); }
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)); }