예제 #1
0
        public UserOnline GetUserOnline()
        {
            var        uid = CurrentUser().UserId;
            UserOnline uo  = Chat.UsersOnline.SingleOrDefault(u => u.UserId == uid);

            if (uo == null)
            {
                uo                   = new UserOnline();
                uo.UserId            = uid;
                uo.ConnIdRoomIdPairs = new List <UserConnIdRoomId>();
                Chat.UsersOnline.Add(uo);
            }
            return(uo);
        }
        public UserOnline GetUserOnline()
        {
            var uid = CurrentUser().UserId;
            UserOnline uo = Chat.UsersOnline.SingleOrDefault(u => u.UserId == uid);

            if (uo == null)
            {
                uo = new UserOnline();
                uo.UserId = uid;
                uo.ConnIdRoomIdPairs = new List<UserConnIdRoomId>();
                Chat.UsersOnline.Add(uo);
            }
            return uo;
        }