public TestorTreeItem[] GetTestRequirements(int testId) { Provider.TestRoles(TestorUserRole.Anonymous, TestorUserRole.Student, TestorUserRole.Administrator, TestorUserRole.Teacher, TestorUserRole.Laboratorian); using (DataClassesTestorCoreDataContext dataContext = new DataClassesTestorCoreDataContext(TestorSecurityProvider.ConnectionString)) { var req = dataContext.GetTestRequirements(testId); List <TestorTreeItem> retValue = new List <TestorTreeItem>(); foreach (var current in req) { TestorTreeItem item = new TestorTreeItem( current.NodeId, current.Requirement, current.TestName, TestorItemType.Test, null); retValue.Add(item); } return(retValue.ToArray()); } }