Exemple #1
0
        // Admin
        public List <AppUser> GetAllRoleUsers()
        {
            var roleId = _roleManager.GetUserRoleId();

            var usersList = _userRoleManager.ListQueryable().Where(x => x.AppRoleId == roleId).Select(u => u.AppUser).ToList();

            return(usersList);
        }
        public List <LastVisit> GetAllUsersVisits()
        {
            var roleId  = _roleManager.GetUserRoleId();
            var usersId = _userRoleManager.ListQueryable().Where(x => x.AppRoleId == roleId).Select(u => u.AppUserId).ToList();

            var visistList = ListQueryable().Where(x => usersId.Contains(x.AppUserId)).ToList();

            return(visistList);
        }
        public List <Log> GetAllUsersLogs()
        {
            var roleId   = _roleManager.GetUserRoleId();
            var userName = _userRoleManager.ListQueryable().Where(x => x.AppRoleId == roleId).Select(u => u.AppUser.Username).ToList();

            var logList = ListQueryable().Where(x => userName.Contains(x.Username)).ToList();


            return(logList);
        }