src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/Serializer.cs
/// <summary>
/// Reads all instances of relationship Association.
/// </summary>
/// <remarks>
/// The caller will position the reader at the open tag of the first XML element inside the relationship tag, so it can be
/// either the first instance, or a bogus tag. This method will deserialize all instances and ignore all bogus tags. When the
/// method returns, the reader will be positioned at the end tag of the relationship (or EOF if somehow that happens).
/// </remarks>
/// <param name="serializationContext">Serialization context.</param>
/// <param name="element">In-memory EntityType instance that will get the deserialized data.</param>
/// <param name="reader">XmlReader to read serialized data from.</param>
Reads all instances of relationship Association.
Reads all instances of relationship Association .
private static void ReadAssociationInstances(DslModeling::SerializationContext serializationContext, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType element, global::System.Xml.XmlReader reader)
		{
			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
			{
				DslModeling::DomainClassXmlSerializer newAssociationSerializer = serializationContext.Directory.GetSerializer(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.DomainClassId);
				global::System.Diagnostics.Debug.Assert(newAssociationSerializer != null, "Cannot find serializer for global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association!");
				global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association newAssociation = newAssociationSerializer.TryCreateInstance (serializationContext, reader, element.Partition) as global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association;
				if (newAssociation != null)
				{
					DslModeling::DomainRoleInfo.SetRolePlayer (newAssociation, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.SourceEntityTypeDomainRoleId, element);
					DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newAssociation.GetDomainClass().Id);	
					global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newAssociation.GetDomainClass().Name + "!");
					targetSerializer.Read(serializationContext, newAssociation, reader);
				}
				else
				{	
					DslModeling::DomainClassXmlSerializer newEntityTypeMonikerOfAssociationSerializer = serializationContext.Directory.GetSerializer(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType.DomainClassId);
					global::System.Diagnostics.Debug.Assert(newEntityTypeMonikerOfAssociationSerializer != null, "Cannot find serializer for global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType!");
					DslModeling::Moniker newEntityTypeMonikerOfAssociation = newEntityTypeMonikerOfAssociationSerializer.TryCreateMonikerInstance(serializationContext, reader, element, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.DomainClassId, element.Partition);
					if (newEntityTypeMonikerOfAssociation != null)
					{
						MicrosoftDataEntityDesignSerializationBehaviorSerializationMessages.ExpectingFullFormRelationship(serializationContext, reader, typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association));
						new global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association(element.Partition, new DslModeling::RoleAssignment(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.SourceEntityTypeDomainRoleId, element), new DslModeling::RoleAssignment(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.Association.TargetEntityTypeDomainRoleId, newEntityTypeMonikerOfAssociation));
						DslModeling::SerializationUtilities.Skip(reader);	
					}
					else
					{	
						DslModeling::SerializationUtilities.Skip(reader);
					}
				}
			}
		}
private static void ReadAssociationInstances ( DslModeling :: SerializationContext serializationContext , global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityType element , global :: System . Xml . XmlReader reader ) { while ( ! serializationContext . Result . Failed && ! reader . EOF && reader . NodeType == global :: System . Xml . XmlNodeType . Element ) { DslModeling :: DomainClassXmlSerializer newAssociationSerializer = serializationContext . Directory . GetSerializer ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . Association . DomainClassId ) ; global :: System . Diagnostics . Debug . Assert ( newAssociationSerializer != null , " " ) ; global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . Association newAssociation = newAssociationSerializer . TryCreateInstance ( serializationContext , reader , element . Partition ) as global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . Association ; if ( newAssociation != null ) { DslModeling :: DomainRoleInfo . SetRolePlayer ( newAssociation , global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . Association . SourceEntityTypeDomainRoleId , element ) ; DslModeling :: DomainClassXmlSerializer targetSerializer = serializationContext . Directory . GetSerializer ( newAssociation . GetDomainClass ( ) . Id ) ; global :: System . Diagnostics . Debug . Assert ( targetSerializer != null , " " + newAssociation . GetDomainClass ( ) . Name + " " ) ; targetSerializer . Read ( serializationContext , newAssociation , reader ) ; } else { DslModeling :: DomainClassXmlSerializer newEntityTypeMonikerOfAssociationSerializer = serializationContext . Directory . GetSerializer ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityType . DomainClassId ) ; global :: System . Diagnostics . Debug . Assert ( newEntityTypeMonikerOfAssociationSerializer != null , " " ) ; DslModeling :: Moniker newEntityTypeMonikerOfAssociation = newEntityTypeMonikerOfAssociationSerializer . TryCreateMonikerInstance ( serializationContext , reader , element , global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . Association . DomainClassId , element . Partition ) ; if ( newEntityTypeMonikerOfAssociation != null ) { MicrosoftDataEntityDesignSerializationBehaviorSerializationMessages . ExpectingFullFormRelationship ( serializationContext , reader , typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . Association ) ) ; new global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . Association ( element . Partition , new DslModeling :: RoleAssignment ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . Association . SourceEntityTypeDomainRoleId , element ) , new DslModeling :: RoleAssignment ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . Association . TargetEntityTypeDomainRoleId , newEntityTypeMonikerOfAssociation ) ) ; DslModeling :: SerializationUtilities . Skip ( reader ) ; } else { DslModeling :: SerializationUtilities . Skip ( reader ) ; } } } }
Reads all instances of relationship Association.
Reads all instances of relationship Association .
// Maybe the relationship is serialized in short-form by mistake. // Moniker contains no child XML elements, so just skip. // Unknown element, skip.
serializationContext
DslModeling::SerializationContext
None
element
global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType
In-memory EntityType instance that will get the deserialized data.
In - memory EntityType instance that will get the deserialized data .
reader
global::System.Xml.XmlReader
XmlReader to read serialized data from.
XmlReader to read serialized data from .
remarks
The caller will position the reader at the open tag of the first XML element inside the relationship tag, so it can be
either the first instance, or a bogus tag. This method will deserialize all instances and ignore all bogus tags. When the
method returns, the reader will be positioned at the end tag of the relationship (or EOF if somehow that happens).
The caller will position the reader at the open tag of the first XML element inside the relationship tag so it can be either the first instance or a bogus tag . This method will deserialize all instances and ignore all bogus tags . When the method returns the reader will be positioned at the end tag of the relationship ( or EOF if somehow that happens ) .