Example #1
0
 public PostsModel(Post post)
 {
     PostId    = post.PostId;
     PostTitle = post.PostTitle;
     AuthorId  = post.AuthorId;
     Author    = UserDAO.GetUsername(post.AuthorId);
     PostDate  = post.PostDate;
     if (post.PostBody.Length > 296)
     {
         PostBody = post.PostBody.Substring(1, 296);
     }
     else
     {
         PostBody = post.PostBody;
     }
     CommentsCount = CommentDAO.GetCommentsCount(post.PostId);
 }