Question
Multiple Choice
You are developing an applicaton. The applicaton converts a Locaton object to a string by using a method named WriteObject. The WriteObject() method accepts two parameters, a Locaton object and an XmlObjectSerializer object. The applicaton includes the following code. (Line numbers are included for reference only.)
You need to serialize the Locaton object as a JSON object.
Which code segment should you insert at line 20?
- A. New DataContractSerializer(typeof(Locaton))
- B. New XmlSerializer(typeof(Locaton))
- C. New NetDataContractSenalizer()
- D. New DataContractJsonSerializer(typeof(Locaton))