src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/Serializer.cs
/// <summary>
/// Reads all instances of relationship EntityTypeHasNavigationProperties.
/// </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 EntityTypeHasNavigationProperties.
Reads all instances of relationship EntityTypeHasNavigationProperties .
private static void ReadEntityTypeHasNavigationPropertiesInstances(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 newNavigationPropertyOfEntityTypeHasNavigationPropertiesSerializer = serializationContext.Directory.GetSerializer(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.NavigationProperty.DomainClassId);
				global::System.Diagnostics.Debug.Assert(newNavigationPropertyOfEntityTypeHasNavigationPropertiesSerializer != null, "Cannot find serializer for global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.NavigationProperty!");
				global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.NavigationProperty newNavigationPropertyOfEntityTypeHasNavigationProperties = newNavigationPropertyOfEntityTypeHasNavigationPropertiesSerializer.TryCreateInstance(serializationContext, reader, element.Partition) as global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.NavigationProperty;
				if (newNavigationPropertyOfEntityTypeHasNavigationProperties != null)
				{
					element.NavigationProperties.Add(newNavigationPropertyOfEntityTypeHasNavigationProperties);
					DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newNavigationPropertyOfEntityTypeHasNavigationProperties.GetDomainClass().Id);	
					global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newNavigationPropertyOfEntityTypeHasNavigationProperties.GetDomainClass().Name + "!");
					targetSerializer.Read(serializationContext, newNavigationPropertyOfEntityTypeHasNavigationProperties, reader);
				}
				else
				{
					global::System.Type typeofEntityTypeHasNavigationProperties = typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties);
					DslModeling::DomainRelationshipXmlSerializer newEntityTypeHasNavigationPropertiesSerializer = serializationContext.Directory.GetSerializer(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.DomainClassId) as DslModeling::DomainRelationshipXmlSerializer;
					global::System.Diagnostics.Debug.Assert(newEntityTypeHasNavigationPropertiesSerializer != null, "Cannot find serializer for global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties!");
					global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties newEntityTypeHasNavigationProperties = newEntityTypeHasNavigationPropertiesSerializer.TryCreateInstance (serializationContext, reader, element.Partition) as global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties;
					if (newEntityTypeHasNavigationProperties != null)
					{
						if (newEntityTypeHasNavigationProperties.GetType() == typeofEntityTypeHasNavigationProperties)
						{	
							MicrosoftDataEntityDesignSerializationBehaviorSerializationMessages.ExpectingShortFormRelationship(serializationContext, reader, typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties));
						}
						DslModeling::DomainRoleInfo.SetRolePlayer (newEntityTypeHasNavigationProperties, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.EntityTypeDomainRoleId, element);
						DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newEntityTypeHasNavigationProperties.GetDomainClass().Id);	
						global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newEntityTypeHasNavigationProperties.GetDomainClass().Name + "!");
						targetSerializer.Read(serializationContext, newEntityTypeHasNavigationProperties, reader);
					}
					else
					{	
						DslModeling::SerializationUtilities.Skip(reader);
					}
				}
			}
		}
private static void ReadEntityTypeHasNavigationPropertiesInstances ( 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 newNavigationPropertyOfEntityTypeHasNavigationPropertiesSerializer = serializationContext . Directory . GetSerializer ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . NavigationProperty . DomainClassId ) ; global :: System . Diagnostics . Debug . Assert ( newNavigationPropertyOfEntityTypeHasNavigationPropertiesSerializer != null , " " ) ; global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . NavigationProperty newNavigationPropertyOfEntityTypeHasNavigationProperties = newNavigationPropertyOfEntityTypeHasNavigationPropertiesSerializer . TryCreateInstance ( serializationContext , reader , element . Partition ) as global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . NavigationProperty ; if ( newNavigationPropertyOfEntityTypeHasNavigationProperties != null ) { element . NavigationProperties . Add ( newNavigationPropertyOfEntityTypeHasNavigationProperties ) ; DslModeling :: DomainClassXmlSerializer targetSerializer = serializationContext . Directory . GetSerializer ( newNavigationPropertyOfEntityTypeHasNavigationProperties . GetDomainClass ( ) . Id ) ; global :: System . Diagnostics . Debug . Assert ( targetSerializer != null , " " + newNavigationPropertyOfEntityTypeHasNavigationProperties . GetDomainClass ( ) . Name + " " ) ; targetSerializer . Read ( serializationContext , newNavigationPropertyOfEntityTypeHasNavigationProperties , reader ) ; } else { global :: System . Type typeofEntityTypeHasNavigationProperties = typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityTypeHasNavigationProperties ) ; DslModeling :: DomainRelationshipXmlSerializer newEntityTypeHasNavigationPropertiesSerializer = serializationContext . Directory . GetSerializer ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityTypeHasNavigationProperties . DomainClassId ) as DslModeling :: DomainRelationshipXmlSerializer ; global :: System . Diagnostics . Debug . Assert ( newEntityTypeHasNavigationPropertiesSerializer != null , " " ) ; global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityTypeHasNavigationProperties newEntityTypeHasNavigationProperties = newEntityTypeHasNavigationPropertiesSerializer . TryCreateInstance ( serializationContext , reader , element . Partition ) as global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityTypeHasNavigationProperties ; if ( newEntityTypeHasNavigationProperties != null ) { if ( newEntityTypeHasNavigationProperties . GetType ( ) == typeofEntityTypeHasNavigationProperties ) { MicrosoftDataEntityDesignSerializationBehaviorSerializationMessages . ExpectingShortFormRelationship ( serializationContext , reader , typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityTypeHasNavigationProperties ) ) ; } DslModeling :: DomainRoleInfo . SetRolePlayer ( newEntityTypeHasNavigationProperties , global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityTypeHasNavigationProperties . EntityTypeDomainRoleId , element ) ; DslModeling :: DomainClassXmlSerializer targetSerializer = serializationContext . Directory . GetSerializer ( newEntityTypeHasNavigationProperties . GetDomainClass ( ) . Id ) ; global :: System . Diagnostics . Debug . Assert ( targetSerializer != null , " " + newEntityTypeHasNavigationProperties . GetDomainClass ( ) . Name + " " ) ; targetSerializer . Read ( serializationContext , newEntityTypeHasNavigationProperties , reader ) ; } else { DslModeling :: SerializationUtilities . Skip ( reader ) ; } } } }
Reads all instances of relationship EntityTypeHasNavigationProperties.
Reads all instances of relationship EntityTypeHasNavigationProperties .
// The relationship should be serialized in short-form. // 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 ) .