Example #1
0
 public static Post CreatePost(string content, User user)
 {
     var post = new Post()
     {
         Id = Guid.NewGuid(),
         Content = content,
         PostedOn = DateTime.Now.ToUniversalTime(),
         PostedBy_Id = user.Id,
         PostedBy = user,
         Show = true,
         Votes = 0,
         Comments = new List<Comment>()
     };
     return post;
 }
Example #2
0
 public void AddPost(Post post)
 {
     Posts.Add(post);
     PostCount++;
 }