public static CommentViewModel Map(Comment model) { var viewModel = mapper.Map(model); viewModel.AuthorId = model.UserId; viewModel.Author = AuthorMapper.Map(model.User); viewModel.ArticleId = model.ArticleId; 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 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); }