Esempio n. 1
0
        public ActionResult Show(Guid key)
        {
            var commentsPerTopic = _topicDriver.GetTopicWithComments(key, PageConstants.FirstPageNumber, DefaultSetting.CommentsPerPage);

            if (commentsPerTopic == null)
            {
                return(HttpNotFound());
            }

            ScriptRegister.AddJson("commentsPerTopic", _topicDriver.ToTopicWithCommentsClient(commentsPerTopic));

            var newComment = _commentDriver.Create();

            newComment.TopicId = commentsPerTopic.Topic.Id;
            newComment.Topic   = commentsPerTopic.Topic;
            ScriptRegister.AddJson("newComment", _commentDriver.ToClient(newComment));

            ViewBag.CurrentThread = _threadDriver.Get(commentsPerTopic.Topic.ThreadId);

            return(View());
        }