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; }
public void AddPost(Post post) { Posts.Add(post); PostCount++; }