nerdexam
Microsoft

70-513 · Question #219

You are developing a Windows Communication Foundation (WCF) service that contains the following service contract. <ServiceContract() > Public Interface IPaymentService <OperationContract() > Sub…

The correct answer is D. Add the following KnownType attributes to the Person class. See the full explanation below for the reasoning.

Question

You are developing a Windows Communication Foundation (WCF) service that contains the following service contract. <ServiceContract() > Public Interface IPaymentService <OperationContract() > Sub RecordPayments(ByVal person As Person) End Interface Public Class Person End Class Public Class Employee Inherits Person End Class Public Class Customer Inherits Person End Class You need to ensure that RecordPayments can correctly deserialize into an Employee or a Customer object. What should you do?

Options

  • AAdd the following KnownType attribute to the Employee class and to the Customer class.
  • BImplement the IExtensibleDataObject interface in the Person class.
  • CImplement the IExtension(Of T) interface in the Person class.
  • DAdd the following KnownType attributes to the Person class.

How the community answered

(22 responses)
  • A
    9% (2)
  • B
    5% (1)
  • C
    14% (3)
  • D
    73% (16)

Community Discussion

No community discussion yet for this question.

Full 70-513 Practice