I have a list in LINQtoSQL and it has various relation in tables and now i want to convert this list into XML.
I am using this code
new XmlSerializer(typeof(T), IncludedTypes).Serialize(xmlWriter, this.Data);
where this.Data has the list data.
but it throws an error
There was an error generating the XML document.
because our tables has related to each other and in our list it also maintains all tables relations
Now How to convert a list into a xml?
circular reference was detected while serializing an object of type abc.Core.Model.Channelthat means
Channelobject has a property refers to another object and that object has a property refers toChannelobject.for example
When serializing
Parent.Childit will serializeChild.Parentso it will serializeParent.Childagain etc.to solve this problem check this post