public bool ParentStar(int statementNumber1, int statementNumber2) { if (ParentTable.Where(x => x.ContainerStatementNumber == statementNumber1 && x.ChildsStatementNumber.Contains(statementNumber2)).Any()) { return(true); } ParrentTableCell cell = ParentTable.Where(x => x.ChildsStatementNumber.Contains(statementNumber2)).FirstOrDefault(); if (cell == null) { return(false); } return(ParentStar(statementNumber1, cell.ContainerStatementNumber)); }
/// <summary> /// Returns if container statement given in statementNumber1 is parent for statement given in statementNumber2 /// </summary> public bool Parent(int statementNumber1, int statementNumber2) { return(ParentTable.Where(x => x.ContainerStatementNumber == statementNumber1 && x.ChildsStatementNumber.Contains(statementNumber2)).Any()); }