示例#1
0
        public void update(Question question)
        {
            QuestionUpdater updater = new QuestionUpdater(unswerManipalator,
                                                          queryConfigurator);

            updater.update(question);
        }
 public Task <Question> UpdateQuestionAsync(int id, QuestionUpdater updater)
 {
     if (!_questions.TryGetValue(id, out var question))
     {
         throw new System.Data.DataException("Not exists");
     }
     if (updater.Title != null)
     {
         question.Title = updater.Title;
     }
     if (updater.Body != null)
     {
         question.Body = updater.Body;
     }
     if (updater.CreatorId != null)
     {
         question.CreatorId = updater.CreatorId.Value;
     }
     return(Task.FromResult(question));
 }