public string AddComment(int intValue, string text) { if (this.Data.CurrentUser == null) { return "There is no currently logged in user"; } if (!this.Data.IssuesById.ContainsKey(intValue)) { return string.Format("There is no issue with ID {0}", intValue); } var issue = this.Data.IssuesById[intValue]; var comment = new Comment(this.Data.CurrentUser, text); issue.AddComment(comment); this.Data.CommentsByUser[this.Data.CurrentUser].Add(comment); return string.Format("Comment added successfully to issue {0}", issue.Id); }
public void AddComment(Comment comment) { this.Comments.Add(comment); }