You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 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?
A.
Apply the [Serializable] attribute to the entities.
B.
Apply the [DataContract(IsReference = true)] attribute to the entities.
C.
Apply the [DataContract(IsReference = false)] attribute to the entities.
D.
Apply the virtual keyword to the entity properties.
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.