BLL.ActiveImagingTask.ReadAll C# (CSharp) Method

ReadAll() public static method

public static ReadAll ( int userId ) : List
userId int
return List
        public static List<Models.ActiveImagingTask> ReadAll(int userId)
        {
            using (var uow = new DAL.UnitOfWork())
            {
                //Admins see all tasks
                var activeImagingTasks = BLL.User.IsAdmin(userId)
                    ? uow.ActiveImagingTaskRepository.Get(orderBy: q => q.OrderBy(t => t.Id))
                    : uow.ActiveImagingTaskRepository.Get(x => x.UserId == userId, orderBy: q => q.OrderBy(t => t.Id));
                foreach (var task in activeImagingTasks)
                {
                    task.Computer = BLL.Computer.GetComputer(task.ComputerId);
                }
                return activeImagingTasks;
            }
        }