private SQLColumnList GetKeys(XmlNode node, SQLColumnList keys = null) { if (keys == null) { keys = new SQLColumnList(); } var keyNode = node.SelectSingleNode("./__keys__"); if (keyNode != null) { var localKeys = new SQLColumnList(); foreach (XmlNode key in keyNode.ChildNodes) { localKeys.Add(Schema.Tables[node.Name].Columns[key.Name]); } keys.InsertRange(0, localKeys); } if (node.ParentNode != null) { keys = GetKeys(node.ParentNode, keys); } return(keys); }
public void DefineKeys(XmlDocument KeyDefinitions) { XmlNode tableNode = KeyDefinitions.SelectSingleNode("//" + Name); if (tableNode != null) { Keys = GetKeys(tableNode); } }