public async Task <bool> Handle(AnswerCommand request, CancellationToken cancellationToken) { var question = _questionRepository.GetById(request.QuestionId); if (question == null) { //todo: Send error message return(false); } var answer = new AnswerEntity( request.Body, request.UserId, AnswerKind.Answer, votes: 0); answer.DefineId(request.Id); answer.SetParent(question); await _answerRepository.RegisterAsync(answer); return(true); }