Beispiel #1
0
        public RedirectToActionResult AddComment(string title, string commentText, string commenter)
        {
            StoryResponse story = repo.GetStoryByTitle(title);

            repo.AddComment(story, new Comment()
            {
                Commenter = new User()
                {
                    Username = commenter
                },
                CommentText = commentText
            });
            ViewBag.newestCommenter = "Thanks for the comment!";
            return(RedirectToAction("UserStories"));
        }
        public RedirectToActionResult AddComment(string title,
                                                 string commentText,
                                                 string contributor)
        {
            Story story = repo.GetStoryByTitle(title);

            repo.AddComment(story, new Comment()
            {
                Contributor = new User()
                {
                    Name = contributor
                },
                CommentText = commentText
            });
            return(RedirectToAction("Stories"));
        }