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; }
public void Answer(Answer answer) { answer.PostedDate = DateTime.Now; answerStorage.Add(answer); }
public static AnswerViewModel Map(Answer answer) { AnswerViewModel viewModel = AnswerMapper.Map(answer); viewModel.Question = QuestionSmallMapper.Map(answer.Question); return viewModel; }
public void NotifyAboutNewAnswer(Answer answer) { throw new NotSupportedException(); }
public void Answer(Answer answer) { answer.UserId = GetCurrentUser().Id; QuestionService.Answer(answer); NotificationService.NotifyAboutNewAnswer(answer); }
public AnswerNotification(Answer answer, IDataContext context) { this.answer = answer; this.context = context; }
public void Add(Answer answer) { Add(answer, Entities.Answers); }