public virtual Inbox GetInbox() { var inbox = new Inbox(); ISet<Comment> comments = GetAllProfileComments(); foreach (var comment in comments){ var message = new Message(comment); inbox.addMessage(message); } foreach (var group in Groups){ foreach (var post in group.MessageList.groupPostList){ var message = new Message(post); inbox.addMessage(message); } } inbox.sortAndTruncateMessages(); return inbox; }
public void addMessage(Message message) { messages.Add(message); }