Which code segment should you insert at line 20?

You are developing an application. The application converts a Location object to a string by using a method named WriteObject. The WriteObject() method accepts two parameters, a Location object and an XmlObjectSerializer object.

The application includes the following code. (Line numbers are included for reference only.)

You need to serialize the Location object as XML.

Which code segment should you insert at line 20?
A . new XmlSerializer(typeof(Location))
B . new NetDataContractSerializer()
C . new DataContractJsonSerializer(typeof (Location))
D . new DataContractSerializer(typeof(Location))

Answer: D

Explanation:

The code is using [DataContract] attribute here so need to used DataContractSerializer class.

Latest 70-483 Dumps Valid Version with 288 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments