public IEADiagram[] GetDiagrams() { string sql = @"Select t_diagramobjects.Diagram_ID FROM t_diagramobjects WHERE t_diagramobjects.Object_ID = " + ID + ";"; IEARepository repository = EARepository.Instance; var document = new XmlDocument(); document.LoadXml(repository.Query(sql)); XmlNodeList diagramIDs = document.GetElementsByTagName(@"Diagram_ID"); return((from XmlNode diagramId in diagramIDs select EAUtilities.ParseToInt32(diagramId.InnerText, -1) into id where id > 0 select repository.GetDiagramByID(id)).ToArray()); }