Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Closed Issue: Xml serialization, property order and OData support [218]

$
0
0
Since the latest release (the RC build in NuGet) it seems like there's a new issue that I haven't noticed earlier.

The current release has two xml serializers that it can support out of the box: the XmlSerializer and the DataContractSerializer.

The DataContractSerializer supports types like IQueryable<T>, and so can be used to filter the resultset using OData query attributes. The downside if this serializer is that it forces the elements to be in a specific order. If you try to create a new object (post to the api), the properties have to be in strict order or they will be ignored.

The XmlSerializer has no issues with property orders. As I read elsewhere: "In XML schema-lingo, the DataContractSerializer uses a xs:sequence logic, while the XmlSerializer uses (by default) a xs:all logic."
The problem is that it doesn't support IQueryable<T> or IEnumerable<T> types. You can only pass in a list or an array, which will not work well if your results come from a large database.

None of these issues are present with the Json serializer though.

Can this be fixed? (for example by allowing data to be paged/filtered before it's parsed to the XmlSerializer)
Comments: Hongye has verified that it works with both IQ and IE with the latest bits.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>