Exemplo n.º 1
0
        public ActionResult <string> GetForumPanel(string id)
        {
            ForumPanelView result = this.Manager.GetForumPanel(id, this.Identity);

            result.Users.ForEach(user =>
            {
                user.IsConnected = this.Cache.usersIdWebSocket.Values.Contains(user.Id);
            });
            return(this.Ok(result));
        }
Exemplo n.º 2
0
        public ForumPanelView GetForumPanel(string id, UserIdentity identity)
        {
            ForumObj forum = this.GetForumById(id);

            ForumPanelView panel = new ForumPanelView();

            if (forum == null)
            {
                return(panel);
            }

            panel.Forum    = forum.ToViewForum();
            panel.Channels = forum.Channels.Select(channel => channel.ToChannelView()).ToList();
            panel.Users    = forum.Users.Select(user => user.ToUserView()).ToList();

            return(panel);
        }