2.2.6.5.6 Collection of Complex Type
In the OData 3.0 protocol, a collection property of complex types, defined on an EntityType, MUST be represented in the same way that it is in the Atom-based format, as specified in section Collection Property (section 2.2.6.2.9). However, the XML element that represents the collection instance as a whole MUST be the root of the XML document (not a child element, as described in Collection Property of Complex Type (section 2.2.6.2.9.1)). For example, the Address property of type AlternateAddresses (a ComplexType) in the sample model (see Appendix A: Sample EDM and CSDL Document (section 6) ) is represented in the following listing.
-
<?xml version="1.0" encoding="utf-8"?> <d: AlternateAddresses m:type="Collection(SampleModel.Address)" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <d:element m:type="Collection(SampleModel.EAddress)> <d:Street>123 contoso street</d:Street> </d:element> <d:element > <d:Street>834 1st street</d:Street> <d:Apartment>102</d:Apartment> </d:element> </d: AlternateAddresses>
Listing: XML Formatted Collection of Complex Type