public RelationshipReferenceMapping DeserialiseRelationshipMapping(XmlNode relationshipMappingNode, IDatabase database, EntitySet set) { NodeProcessor proc = new NodeProcessor(relationshipMappingNode); RelationshipReferenceMapping mapping = new RelationshipReferenceMappingImpl(); Guid fromRelationshipId = proc.GetGuid("FromRelationship"); Guid toReferenceId = proc.GetGuid("ToReference"); mapping.FromRelationship = database.Relationships.FirstOrDefault(r => r.Identifier == fromRelationshipId); mapping.ToReference = set.References.FirstOrDefault(r => r.Identifier == toReferenceId); if (mapping.ToReference == null) { return(null); } ProcessScriptBase(mapping, relationshipMappingNode); return(mapping); }
public TableReferenceMapping DeserialiseReferenceMapping(XmlNode referenceMappingNode, IDatabase database, EntitySet set) { NodeProcessor proc = new NodeProcessor(referenceMappingNode); TableReferenceMapping mapping = new TableReferenceMappingImpl(); string fromTableName = proc.GetString("FromTable"); string fromSchema = proc.GetString("FromSchema"); Guid toReferenceIdentifier = proc.GetGuid("ToReference"); var reference = set.References.FirstOrDefault(r => r.Identifier == toReferenceIdentifier); mapping.FromTable = database.GetTable(fromTableName, fromSchema); mapping.ToReference = reference; ProcessScriptBase(mapping, referenceMappingNode); return(mapping); }
public RelationshipReferenceMapping DeserialiseRelationshipMapping(XmlNode relationshipMappingNode, IDatabase database, EntitySet set) { NodeProcessor proc = new NodeProcessor(relationshipMappingNode); RelationshipReferenceMapping mapping = new RelationshipReferenceMappingImpl(); Guid fromRelationshipId = proc.GetGuid("FromRelationship"); Guid toReferenceId = proc.GetGuid("ToReference"); mapping.FromRelationship = database.Relationships.FirstOrDefault(r => r.Identifier == fromRelationshipId); mapping.ToReference = set.References.FirstOrDefault(r => r.Identifier == toReferenceId); if (mapping.ToReference == null) return null; ProcessScriptBase(mapping, relationshipMappingNode); return mapping; }
public TableReferenceMapping DeserialiseReferenceMapping(XmlNode referenceMappingNode, IDatabase database, EntitySet set) { NodeProcessor proc = new NodeProcessor(referenceMappingNode); TableReferenceMapping mapping = new TableReferenceMappingImpl(); string fromTableName = proc.GetString("FromTable"); string fromSchema = proc.GetString("FromSchema"); Guid toReferenceIdentifier = proc.GetGuid("ToReference"); var reference = set.References.FirstOrDefault(r => r.Identifier == toReferenceIdentifier); mapping.FromTable = database.GetTable(fromTableName, fromSchema); mapping.ToReference = reference; ProcessScriptBase(mapping, referenceMappingNode); return mapping; }