/// <summary> /// Function for getting list of active user. /// </summary> /// <returns>Returns list of active user.</returns> public List <User> GetActiveUsers(User currentUser) { if (currentUser.IsAdministrator && !currentUser.TeamId.HasValue) { return(UserDataAccesor.GetActiveUsers()); } return(currentUser.TeamId.HasValue ? UserDataAccesor.GetActiveUsersByTeam(currentUser.TeamId.Value).Where(x => !currentUser.IsTrainee || !x.IsTrainee || x.UserId == currentUser.UserId).ToList() : new List <User>()); }