public static DetailsPostViewModel CreateViewModel(Post p) { var model = new DetailsPostViewModel { PostId = p.Id, Created = p.CreatedDate.ToString(), UserName = p.CreatedBy, Subject = p.Subject, Body = p.Body, IsAnswer = p.Question.CreatedBy != p.CreatedBy, IsMarkedAsAnswer = p.Accepted }; return model; }
public static DetailsPostViewModel CreateViewModel(Post p) { var model = new DetailsPostViewModel { PostId = p.Id, Created = p.CreatedDate.ToString(), UserName = p.CreatedBy, Subject = p.Subject, Body = p.Body, IsAnswer = p.Question.CreatedBy != p.CreatedBy, IsMarkedAsAnswer = p.Accepted }; return(model); }