src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/Serializer.cs
/// <summary>
/// Reads all instances of relationship EntityDesignerViewModelHasEntityTypes.
/// </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 EntityDesignerViewModel instance that will get the deserialized data.</param>
/// <param name="reader">XmlReader to read serialized data from.</param>
Reads all instances of relationship EntityDesignerViewModelHasEntityTypes.
Reads all instances of relationship EntityDesignerViewModelHasEntityTypes .
private static void ReadEntityDesignerViewModelHasEntityTypesInstances(DslModeling::SerializationContext serializationContext, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel element, global::System.Xml.XmlReader reader)
		{
			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
			{
				DslModeling::DomainClassXmlSerializer newEntityTypeOfEntityDesignerViewModelHasEntityTypesSerializer = serializationContext.Directory.GetSerializer(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType.DomainClassId);
				global::System.Diagnostics.Debug.Assert(newEntityTypeOfEntityDesignerViewModelHasEntityTypesSerializer != null, "Cannot find serializer for global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType!");
				global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType newEntityTypeOfEntityDesignerViewModelHasEntityTypes = newEntityTypeOfEntityDesignerViewModelHasEntityTypesSerializer.TryCreateInstance(serializationContext, reader, element.Partition) as global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType;
				if (newEntityTypeOfEntityDesignerViewModelHasEntityTypes != null)
				{
					element.EntityTypes.Add(newEntityTypeOfEntityDesignerViewModelHasEntityTypes);
					DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newEntityTypeOfEntityDesignerViewModelHasEntityTypes.GetDomainClass().Id);	
					global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newEntityTypeOfEntityDesignerViewModelHasEntityTypes.GetDomainClass().Name + "!");
					targetSerializer.Read(serializationContext, newEntityTypeOfEntityDesignerViewModelHasEntityTypes, reader);
				}
				else
				{
					global::System.Type typeofEntityDesignerViewModelHasEntityTypes = typeof(EntityDesignerViewModelHasEntityTypes);
					DslModeling::DomainRelationshipXmlSerializer newEntityDesignerViewModelHasEntityTypesSerializer = serializationContext.Directory.GetSerializer(EntityDesignerViewModelHasEntityTypes.DomainClassId) as DslModeling::DomainRelationshipXmlSerializer;
					global::System.Diagnostics.Debug.Assert(newEntityDesignerViewModelHasEntityTypesSerializer != null, "Cannot find serializer for EntityDesignerViewModelHasEntityTypes!");
					EntityDesignerViewModelHasEntityTypes newEntityDesignerViewModelHasEntityTypes = newEntityDesignerViewModelHasEntityTypesSerializer.TryCreateInstance (serializationContext, reader, element.Partition) as EntityDesignerViewModelHasEntityTypes;
					if (newEntityDesignerViewModelHasEntityTypes != null)
					{
						if (newEntityDesignerViewModelHasEntityTypes.GetType() == typeofEntityDesignerViewModelHasEntityTypes)
						{	
							MicrosoftDataEntityDesignSerializationBehaviorSerializationMessages.ExpectingShortFormRelationship(serializationContext, reader, typeof(EntityDesignerViewModelHasEntityTypes));
						}
						DslModeling::DomainRoleInfo.SetRolePlayer (newEntityDesignerViewModelHasEntityTypes, EntityDesignerViewModelHasEntityTypes.EntityDesignerViewModelDomainRoleId, element);
						DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (newEntityDesignerViewModelHasEntityTypes.GetDomainClass().Id);	
						global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + newEntityDesignerViewModelHasEntityTypes.GetDomainClass().Name + "!");
						targetSerializer.Read(serializationContext, newEntityDesignerViewModelHasEntityTypes, reader);
					}
					else
					{	
						DslModeling::SerializationUtilities.Skip(reader);
					}
				}
			}
		}
private static void ReadEntityDesignerViewModelHasEntityTypesInstances ( DslModeling :: SerializationContext serializationContext , global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityDesignerViewModel element , global :: System . Xml . XmlReader reader ) { while ( ! serializationContext . Result . Failed && ! reader . EOF && reader . NodeType == global :: System . Xml . XmlNodeType . Element ) { DslModeling :: DomainClassXmlSerializer newEntityTypeOfEntityDesignerViewModelHasEntityTypesSerializer = serializationContext . Directory . GetSerializer ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityType . DomainClassId ) ; global :: System . Diagnostics . Debug . Assert ( newEntityTypeOfEntityDesignerViewModelHasEntityTypesSerializer != null , " " ) ; global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityType newEntityTypeOfEntityDesignerViewModelHasEntityTypes = newEntityTypeOfEntityDesignerViewModelHasEntityTypesSerializer . TryCreateInstance ( serializationContext , reader , element . Partition ) as global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityType ; if ( newEntityTypeOfEntityDesignerViewModelHasEntityTypes != null ) { element . EntityTypes . Add ( newEntityTypeOfEntityDesignerViewModelHasEntityTypes ) ; DslModeling :: DomainClassXmlSerializer targetSerializer = serializationContext . Directory . GetSerializer ( newEntityTypeOfEntityDesignerViewModelHasEntityTypes . GetDomainClass ( ) . Id ) ; global :: System . Diagnostics . Debug . Assert ( targetSerializer != null , " " + newEntityTypeOfEntityDesignerViewModelHasEntityTypes . GetDomainClass ( ) . Name + " " ) ; targetSerializer . Read ( serializationContext , newEntityTypeOfEntityDesignerViewModelHasEntityTypes , reader ) ; } else { global :: System . Type typeofEntityDesignerViewModelHasEntityTypes = typeof ( EntityDesignerViewModelHasEntityTypes ) ; DslModeling :: DomainRelationshipXmlSerializer newEntityDesignerViewModelHasEntityTypesSerializer = serializationContext . Directory . GetSerializer ( EntityDesignerViewModelHasEntityTypes . DomainClassId ) as DslModeling :: DomainRelationshipXmlSerializer ; global :: System . Diagnostics . Debug . Assert ( newEntityDesignerViewModelHasEntityTypesSerializer != null , " " ) ; EntityDesignerViewModelHasEntityTypes newEntityDesignerViewModelHasEntityTypes = newEntityDesignerViewModelHasEntityTypesSerializer . TryCreateInstance ( serializationContext , reader , element . Partition ) as EntityDesignerViewModelHasEntityTypes ; if ( newEntityDesignerViewModelHasEntityTypes != null ) { if ( newEntityDesignerViewModelHasEntityTypes . GetType ( ) == typeofEntityDesignerViewModelHasEntityTypes ) { MicrosoftDataEntityDesignSerializationBehaviorSerializationMessages . ExpectingShortFormRelationship ( serializationContext , reader , typeof ( EntityDesignerViewModelHasEntityTypes ) ) ; } DslModeling :: DomainRoleInfo . SetRolePlayer ( newEntityDesignerViewModelHasEntityTypes , EntityDesignerViewModelHasEntityTypes . EntityDesignerViewModelDomainRoleId , element ) ; DslModeling :: DomainClassXmlSerializer targetSerializer = serializationContext . Directory . GetSerializer ( newEntityDesignerViewModelHasEntityTypes . GetDomainClass ( ) . Id ) ; global :: System . Diagnostics . Debug . Assert ( targetSerializer != null , " " + newEntityDesignerViewModelHasEntityTypes . GetDomainClass ( ) . Name + " " ) ; targetSerializer . Read ( serializationContext , newEntityDesignerViewModelHasEntityTypes , reader ) ; } else { DslModeling :: SerializationUtilities . Skip ( reader ) ; } } } }
Reads all instances of relationship EntityDesignerViewModelHasEntityTypes.
Reads all instances of relationship EntityDesignerViewModelHasEntityTypes .
// The relationship should be serialized in short-form. // Unknown element, skip
serializationContext
DslModeling::SerializationContext
None
element
global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel
In-memory EntityDesignerViewModel instance that will get the deserialized data.
In - memory EntityDesignerViewModel 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 ) .