Last post May 15, 2015 10:05 AM by Fardream1
Apr 28, 2015 10:06 AM|Fardream1|LINK
Hi, I was trying to set up an OData v3 feed with web api using the tutorial located at the following location:
When I try to force it to return xml, I got the following error serializing EdmEntityObjectCollection.
Can someone point me to the right direction into how to do this?
Thanks a lot.
Apr 29, 2015 11:11 PM|Krunal Parekh|LINK
1. It looks like you are trying to serialize non-serializable objects with cyclical dependencies which are not supported in any of Serializers.
2. EF DataModels have cyclical dependencies making them poor candidates for serialization. You could map them to clean DTO's which can be serialized.
3. Alternatively use any Micro ORM like
Dapper which map resultsets into clean POCO models.
Hope this helps.
Apr 30, 2015 02:46 PM|Fardream1|LINK
Thanks for the reply, Krunal Parekh.
However, the class doesn't have cyclical dependencies and it can be successfully serialized by JSON formatter. I am trying to use a typeless odata endpoint here.
May 15, 2015 10:05 AM|Fardream1|LINK
Figure it out. The DataContract Serializer doesn't support this but the xmlserializer supports.