You are troubleshooting an application that uses a class named FullName. The class is decorated with the DataContractAttribute attribute. The application includes the following code. (Line numbers are included for reference only.)
You need to ensure that the entire FullName object is serialized to the memory stream object.
Which code segment should you insert at line 09?
A. binary.WriteEndElement();
B. binary.NriteEndDocument();
C. ms.Close() ;
D. binary.Flush();
D.
binary.Flush();
D
https://docs.microsoft.com/cs-cz/dotnet/framework/wcf/samples/datacontractserializer-sample
.Flush(): Flushes the output buffer, and causes buffered data to be written to the Listeners.
A throw System.InvalidOperationException
D works fine
Agree. D
D