public async Task <QuestionnaireDto> Handle(QuestionnaireQuery request, CancellationToken cancellationToken) { try { var questionnaiere = await _QuestionaireUnitOfWork.GetOrCreate(request); return(questionnaiere.AsDto()); } catch (NotFoundException nfe) { throw nfe; } }
public async Task <bool> Handle(AnswerQuestionCommand request, CancellationToken cancellationToken) { var questionnaire = await _questionaireUnitOfWork .GetOrCreate(new { request.QuestionnaireId }); questionnaire.AnswerQuestion(request.SubjectId, request.QuestionId, request.AnswerId, request.Answer, request.ExecutionId); await _questionaireUnitOfWork.Commit(); return(true); }