コード例 #1
0
        public ApiResponse GetUserList()
        {
            _userDataProvider = new UserDataProvider();
            var response = _userDataProvider.GetUserList();

            if (response.IsSuccess)
            {
                var userList    = response.Data as List <User>;
                var onlineUsers = ChatHub.GetAllActiveConnections();
                foreach (var item in userList)
                {
                    var a = onlineUsers.FirstOrDefault(x => x.UserId == item.UserId.ToString());
                    item.IsOnline = a != null;
                }
                response.Data = userList;
            }
            return(response);
        }
コード例 #2
0
 public JsonResult GetUserList(SearchUserModel searchParams, int pageSize = 10, int pageIndex = 1, string sortIndex = "ModifiedDate", string sortDirection = "DESC")
 {
     _userDataProvider = new UserDataProvider();
     return(Json(_userDataProvider.GetUserList(searchParams, pageSize, pageIndex, sortIndex, sortDirection)));
 }