BLL.ActiveImagingTask.ReadUnicasts C# (CSharp) Method

ReadUnicasts() public static method

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