public void Ask(Question question) { question.Disciplines = disciplineStorage.Get( question.Disciplines.Select(x => x.Id)).ToList(); question.PostedDate = DateTime.Now; questionStorage.Add(question); }
public static QuestionViewModel Map(Question question) { QuestionViewModel viewModel = new QuestionViewModel(); viewModel.Id = question.Id; viewModel.Title = question.Title; return viewModel; }
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; }
public void NotifyAboutNewQuestion(Question question) { throw new NotSupportedException(); }
public void Ask(Question question) { QuestionService.Ask(question); NotificationService.NotifyAboutNewQuestion(question); }
public void Add(Question question) { Add(question, Entities.Questions); }