src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/SerializationHelper.cs
/// <summary>
/// Return the model in XML format
/// </summary>
/// <param name="modelRoot">Root instance to be saved.</param>
/// <param name="encoding">Encoding to use when saving the root instance.</param>
/// <returns>Model in XML form</returns>
Return the model in XML format
Return the model in XML format
internal virtual string GetSerializedModelString(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel modelRoot, global::System.Text.Encoding encoding)
		{
			string result = string.Empty;
			if (modelRoot == null)
			{
				return result;
			}
			DslModeling::SerializationResult serializationResult = new DslModeling::SerializationResult();
			using (global::System.IO.MemoryStream modelFileContent = this.InternalSaveModel(serializationResult, modelRoot, string.Empty, encoding, false))
			{
				if (!serializationResult.Failed && modelFileContent != null)
				{
					char[] chars = encoding.GetChars(modelFileContent.GetBuffer());
					result = new string( chars);
					int indexPos = result.IndexOf('<');
					if (indexPos > 0)
					{
						result = result.Substring(indexPos);
					}
					result = result.TrimEnd( '\0');
				}
			}
			return result;
		}
internal virtual string GetSerializedModelString ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityDesignerViewModel modelRoot , global :: System . Text . Encoding encoding ) { string result = string . Empty ; if ( modelRoot == null ) { return result ; } DslModeling :: SerializationResult serializationResult = new DslModeling :: SerializationResult ( ) ; using ( global :: System . IO . MemoryStream modelFileContent = this . InternalSaveModel ( serializationResult , modelRoot , string . Empty , encoding , false ) ) { if ( ! serializationResult . Failed && modelFileContent != null ) { char [ ] chars = encoding . GetChars ( modelFileContent . GetBuffer ( ) ) ; result = new string ( chars ) ; int indexPos = result . IndexOf ( ' ' ) ; if ( indexPos > 0 ) { result = result . Substring ( indexPos ) ; } result = result . TrimEnd ( ' \0 ' ) ; } } return result ; }
Return the model in XML format
Return the model in XML format
// search the open angle bracket and trim off the Byte Of Mark. // strip off the leading Byte Of Mark. // trim off trailing 0s.
Model in XML form
Model in XML form
modelRoot
global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel
Root instance to be saved.
Root instance to be saved .
encoding
global::System.Text.Encoding
Encoding to use when saving the root instance.
Encoding to use when saving the root instance .