Example #1
0
        public void AddPostToThread(int threadID, string content)
        {
            Thread thread;
            var    post = _forumContext.InsertPost(threadID, content, out thread);

            PostAdded(post);
            ThreadHub.ThreadUpdated(thread);
        }
Example #2
0
        public IEnumerable <Post> GetForThread(int threadID)
        {
            var group = ThreadHub.GetGroupNameForThread(threadID);

            Groups.Add(Context.ConnectionId, group);

            return(_forumContext.Posts.Where(p => p.ThreadID == threadID));
        }
Example #3
0
        public static void PostAdded(Post post)
        {
            var hubContext = GlobalHost.ConnectionManager.GetHubContext <PostHub>();

            hubContext.Clients.Group(ThreadHub.GetGroupNameForThread(post.ThreadID)).postAdded(post);
        }