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;
 }
Пример #2
0
        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);
        }