Beispiel #1
0
 internal Answer(Question question, string content, User answeredBy)
 {
     var id = Guid.NewGuid();
     
     var answerSuggested = new AnswerSuggested(id, question.Id, content, answeredBy.UserName);
     Apply(answerSuggested);
     Append(answerSuggested);
 }
Beispiel #2
0
 public Answer SuggestAnswerTo(Question question, string answer)
 {
     if (question == null)
         throw new ArgumentNullException("question");
         
     if (string.IsNullOrWhiteSpace(answer))
         throw new ArgumentException("answer");
     
     return new Answer(question, answer, this);
 }
 public void Save(Question question)
 {
     _eventStore.SaveEvents(question.Id, question.GetUncommittedEvents());
 }