Ejemplo n.º 1
0
 public void Ask(Question question)
 {
     question.Disciplines = disciplineStorage.Get(
         question.Disciplines.Select(x => x.Id)).ToList();
     question.PostedDate = DateTime.Now;
     questionStorage.Add(question);
 }
Ejemplo n.º 2
0
 public static QuestionViewModel Map(Question question)
 {
     QuestionViewModel viewModel = new QuestionViewModel();
     viewModel.Id = question.Id;
     viewModel.Title = question.Title;
     return viewModel;
 }
Ejemplo n.º 3
0
 public static QuestionViewModel Map(Question model)
 {
     var viewModel = mapper.Map(model);
     viewModel.Author = AuthorMapper.Map(model.User);
     viewModel.AuthorId = model.UserId;
     viewModel.Disciplines = model.Disciplines.Select(
         DisciplineMapper.Map);
     return viewModel;
 }
Ejemplo n.º 4
0
 public void NotifyAboutNewQuestion(Question question)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 5
0
 public void Ask(Question question)
 {
     QuestionService.Ask(question);
     NotificationService.NotifyAboutNewQuestion(question);
 }
Ejemplo n.º 6
0
 public void Add(Question question)
 {
     Add(question, Entities.Questions);
 }