protected override void DoParse(ICollection <XName> unprocessedElements) { // call base's DoParse() first to process elements base.DoParse(unprocessedElements); // next see if we have a StoreEntitySet attribute if (GetAttributeValue(MappingFragment.AttributeStoreEntitySet) != null) { if (_fragments.Count == 0) { // create a "ghost-node" var frag = new MappingFragment(this, XElement); _fragments.Add(frag); frag.Parse(unprocessedElements); // Add an error - we don't want to support this syntax in the designer. This can be on an EntitySetMapping or an EntityTypeMapping node var elementName = XElement.Name.LocalName; var msg = String.Format( CultureInfo.CurrentCulture, Resources.ModelParse_GhostNodeNotSupportedByDesigner, MappingFragment.AttributeStoreEntitySet, elementName); Artifact.AddParseErrorForObject(this, msg, ErrorCodes.ModelParse_GhostNodeNotSupportedByDesigner); } else { // TypeName attribute and EntityTypeMapping children. These are mutually exclusive. var msg = String.Format( CultureInfo.CurrentCulture, Resources.ModelParse_MutuallyExclusiveAttributeAndChildElement, MappingFragment.AttributeStoreEntitySet, MappingFragment.ElementName); Artifact.AddParseErrorForObject(this, msg, ErrorCodes.ModelParse_MutuallyExclusiveAttributeAndChildElement); } } }
internal override bool ParseSingleElement(ICollection <XName> unprocessedElements, XElement elem) { if (elem.Name.LocalName == MappingFragment.ElementName) { var frag = new MappingFragment(this, elem); _fragments.Add(frag); frag.Parse(unprocessedElements); } else if (elem.Name.LocalName == ModificationFunctionMapping.ElementName) { _modificationFunctionMapping = new ModificationFunctionMapping(this, elem); _modificationFunctionMapping.Parse(unprocessedElements); } else { return(base.ParseSingleElement(unprocessedElements, elem)); } return(true); }
internal override bool ParseSingleElement(ICollection<XName> unprocessedElements, XElement elem) { if (elem.Name.LocalName == MappingFragment.ElementName) { var frag = new MappingFragment(this, elem); _fragments.Add(frag); frag.Parse(unprocessedElements); } else if (elem.Name.LocalName == ModificationFunctionMapping.ElementName) { _modificationFunctionMapping = new ModificationFunctionMapping(this, elem); _modificationFunctionMapping.Parse(unprocessedElements); } else { return base.ParseSingleElement(unprocessedElements, elem); } return true; }
protected override void DoParse(ICollection<XName> unprocessedElements) { // call base's DoParse() first to process elements base.DoParse(unprocessedElements); // next see if we have a StoreEntitySet attribute if (GetAttributeValue(MappingFragment.AttributeStoreEntitySet) != null) { if (_fragments.Count == 0) { // create a "ghost-node" var frag = new MappingFragment(this, XElement); _fragments.Add(frag); frag.Parse(unprocessedElements); // Add an error - we don't want to support this syntax in the designer. This can be on an EntitySetMapping or an EntityTypeMapping node var elementName = XElement.Name.LocalName; var msg = String.Format( CultureInfo.CurrentCulture, Resources.ModelParse_GhostNodeNotSupportedByDesigner, MappingFragment.AttributeStoreEntitySet, elementName); Artifact.AddParseErrorForObject(this, msg, ErrorCodes.ModelParse_GhostNodeNotSupportedByDesigner); } else { // TypeName attribute and EntityTypeMapping children. These are mutually exclusive. var msg = String.Format( CultureInfo.CurrentCulture, Resources.ModelParse_MutuallyExclusiveAttributeAndChildElement, MappingFragment.AttributeStoreEntitySet, MappingFragment.ElementName); Artifact.AddParseErrorForObject(this, msg, ErrorCodes.ModelParse_MutuallyExclusiveAttributeAndChildElement); } } }