Пример #1
0
 public static AnswerViewModel Map(Answer model)
 {
     //AnswerViewModel viewModel = new AnswerViewModel();
     //viewModel.Id = answer.Id;
     //viewModel.QuestionId = answer.QuestionId;
     //viewModel.Text = answer.Text;
     //viewModel.PostedDate = answer.PostedDate;
     //viewModel.Author = AuthorMapper.Map(answer.User);
     var viewModel = mapper.Map(model);
     viewModel.AuthorId = model.UserId;
     viewModel.Author = AuthorMapper.Map(model.User);
     viewModel.QuestionId = model.QuestionId;
     return viewModel;
 }
Пример #2
0
 public void Answer(Answer answer)
 {
     answer.PostedDate = DateTime.Now;
     answerStorage.Add(answer);
 }
Пример #3
0
 public static AnswerViewModel Map(Answer answer)
 {
     AnswerViewModel viewModel = AnswerMapper.Map(answer);
     viewModel.Question = QuestionSmallMapper.Map(answer.Question);
     return viewModel;
 }
Пример #4
0
 public void NotifyAboutNewAnswer(Answer answer)
 {
     throw new NotSupportedException();
 }
Пример #5
0
 public void Answer(Answer answer)
 {
     answer.UserId = GetCurrentUser().Id;
     QuestionService.Answer(answer);
     NotificationService.NotifyAboutNewAnswer(answer);
 }
Пример #6
0
 public AnswerNotification(Answer answer, IDataContext context)
 {
     this.answer = answer;
     this.context = context;
 }
Пример #7
0
 public void Add(Answer answer)
 {
     Add(answer, Entities.Answers);
 }