nerdexam
Microsoft

70-516 · Question #179

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use Plain Old CLR objects (POCO) to model your entities. The application communicates with a…

The correct answer is C. Apply the [DataContract(IsReference = true)] attribute to the entities. DataContractAttribute Specifies that the type defines or implements a data contract and is serializable by a serializer, such as the DataContractSerializer. To make their type serializable, type authors must define a data contract for their type. IsReference Gets or sets a…

Consuming and Exposing Data

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use Plain Old CLR objects (POCO) to model your entities. The application communicates with a Windows Communication Foundation (WCF) Data Services service. You need to ensure that entities can be sent to the service as XML. What should you do?

Options

  • AApply the virtual keyword to the entity properties.
  • BApply the [Serializable] attribute to the entities.
  • CApply the [DataContract(IsReference = true)] attribute to the entities.
  • DApply the [DataContract(IsReference = false)] attribute to the entities.

How the community answered

(29 responses)
  • A
    14% (4)
  • B
    7% (2)
  • C
    76% (22)
  • D
    3% (1)

Explanation

DataContractAttribute Specifies that the type defines or implements a data contract and is serializable by a serializer, such as the DataContractSerializer. To make their type serializable, type authors must define a data contract for their type. IsReference Gets or sets a value that indicates whether to preserve object reference data.

Topics

#WCF Data Services#POCO#DataContract#XML serialization

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice