src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/Serializer.cs
/// <summary>
/// This method reads the target role player NavigationProperty.
/// </summary>
/// <remarks>
/// The caller will guarantee that the reader is positioned at the open tag of the first child XML element.
/// This method will read only one target role player instance. The method will skip any child XML element it encounters until it reaches:
/// 1) The open tag of the target role player.
/// 2) The end tag of the parent element (dangling relationship).
/// 3) EOF (dangling relationship).
/// After the call, the reader is positioned at:
/// 1) The open tag of the next child element after the target role player.
/// 2) The end tag of the parent element.
/// 3) EOF.
/// </remarks>
/// <param name="serializationContext">Serialization context.</param>
/// <param name="element">In-memory EntityTypeHasNavigationProperties instance that will link to the target NavigationProperty instance.</param>
/// <param name="reader">XmlReader to read serialized data from.</param>
This method reads the target role player NavigationProperty.
This method reads the target role player NavigationProperty .
protected virtual void ReadTargetRolePlayer(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement element, global::System.Xml.XmlReader reader)
		{
			#region Check Parameters
			global::System.Diagnostics.Debug.Assert (serializationContext != null);
			if (serializationContext == null)
				throw new global::System.ArgumentNullException ("serializationContext");
			global::System.Diagnostics.Debug.Assert (element != null);
			if (element == null)
				throw new global::System.ArgumentNullException ("element");
			global::System.Diagnostics.Debug.Assert (reader != null);
			if (reader == null)
				throw new global::System.ArgumentNullException ("reader");
			#endregion
			DslModeling::ModelElement targetRolePlayer = null;
			DslModeling::DomainClassXmlSerializer targetRoleSerializer = serializationContext.Directory.GetSerializer(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.NavigationProperty.DomainClassId);
			global::System.Diagnostics.Debug.Assert(targetRoleSerializer != null, "Cannot find serializer for NavigationProperty!");
			while (!serializationContext.Result.Failed && !reader.EOF && reader.NodeType == global::System.Xml.XmlNodeType.Element)
			{
				targetRolePlayer = targetRoleSerializer.TryCreateInstance(serializationContext, reader, element.Partition);
				if (targetRolePlayer != null)
				{
					DslModeling::DomainRoleInfo.SetRolePlayer(element as DslModeling::ElementLink, global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityTypeHasNavigationProperties.NavigationPropertyDomainRoleId, targetRolePlayer);
					DslModeling::DomainClassXmlSerializer targetSerializer = serializationContext.Directory.GetSerializer (targetRolePlayer.GetDomainClass().Id);	
					global::System.Diagnostics.Debug.Assert (targetSerializer != null, "Cannot find serializer for " + targetRolePlayer.GetDomainClass().Name + "!");
					targetSerializer.Read(serializationContext, targetRolePlayer, reader);
					break;
				}
				MicrosoftDataEntityDesignSerializationBehaviorSerializationMessages.UnexpectedXmlElement(serializationContext, reader);
				DslModeling::SerializationUtilities.Skip(reader);
			}
			if (targetRolePlayer == null)
			{
				MicrosoftDataEntityDesignSerializationBehaviorSerializationMessages.DanglingRelationship(serializationContext, reader, "EntityTypeHasNavigationProperties");
			}
		}
protected virtual void ReadTargetRolePlayer ( DslModeling :: SerializationContext serializationContext , DslModeling :: ModelElement element , global :: System . Xml . XmlReader reader ) { region  Check Parameters global :: System . Diagnostics . Debug . Assert ( serializationContext != null ) ; if ( serializationContext == null ) throw new global :: System . ArgumentNullException ( " " ) ; global :: System . Diagnostics . Debug . Assert ( element != null ) ; if ( element == null ) throw new global :: System . ArgumentNullException ( " " ) ; global :: System . Diagnostics . Debug . Assert ( reader != null ) ; if ( reader == null ) throw new global :: System . ArgumentNullException ( " " ) ; endregion DslModeling :: ModelElement targetRolePlayer = null ; DslModeling :: DomainClassXmlSerializer targetRoleSerializer = serializationContext . Directory . GetSerializer ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . NavigationProperty . DomainClassId ) ; global :: System . Diagnostics . Debug . Assert ( targetRoleSerializer != null , " " ) ; while ( ! serializationContext . Result . Failed && ! reader . EOF && reader . NodeType == global :: System . Xml . XmlNodeType . Element ) { targetRolePlayer = targetRoleSerializer . TryCreateInstance ( serializationContext , reader , element . Partition ) ; if ( targetRolePlayer != null ) { DslModeling :: DomainRoleInfo . SetRolePlayer ( element as DslModeling :: ElementLink , global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityTypeHasNavigationProperties . NavigationPropertyDomainRoleId , targetRolePlayer ) ; DslModeling :: DomainClassXmlSerializer targetSerializer = serializationContext . Directory . GetSerializer ( targetRolePlayer . GetDomainClass ( ) . Id ) ; global :: System . Diagnostics . Debug . Assert ( targetSerializer != null , " " + targetRolePlayer . GetDomainClass ( ) . Name + " " ) ; targetSerializer . Read ( serializationContext , targetRolePlayer , reader ) ; break ; } MicrosoftDataEntityDesignSerializationBehaviorSerializationMessages . UnexpectedXmlElement ( serializationContext , reader ) ; DslModeling :: SerializationUtilities . Skip ( reader ) ; } if ( targetRolePlayer == null ) { MicrosoftDataEntityDesignSerializationBehaviorSerializationMessages . DanglingRelationship ( serializationContext , reader , " " ) ; } }
This method reads the target role player NavigationProperty.
This method reads the target role player NavigationProperty .
// Read the instance of target role-player NavigationProperty // Attach the target role-player. // Read target role-player. // Encountered one unknown XML element, skip it and keep reading.
serializationContext
DslModeling::SerializationContext
None
element
DslModeling::ModelElement
In-memory EntityTypeHasNavigationProperties instance that will link to the target NavigationProperty instance.
In - memory EntityTypeHasNavigationProperties instance that will link to the target NavigationProperty instance .
reader
global::System.Xml.XmlReader
XmlReader to read serialized data from.
XmlReader to read serialized data from .
remarks
The caller will guarantee that the reader is positioned at the open tag of the first child XML element.
This method will read only one target role player instance. The method will skip any child XML element it encounters until it reaches:
1) The open tag of the target role player.
2) The end tag of the parent element (dangling relationship).
3) EOF (dangling relationship).
After the call, the reader is positioned at:
1) The open tag of the next child element after the target role player.
2) The end tag of the parent element.
The caller will guarantee that the reader is positioned at the open tag of the first child XML element . This method will read only one target role player instance . The method will skip any child XML element it encounters until it reaches : 1 ) The open tag of the target role player . 2 ) The end tag of the parent element ( dangling relationship ) . 3 ) EOF ( dangling relationship ) . After the call the reader is positioned at : 1 ) The open tag of the next child element after the target role player . 2 ) The end tag of the parent element .