I want to serialize an EF model like this
TableA theObject = db.TableA.find(uid);
XmlSerializer serializer = new XmlSerializer(typeof(TableA));
XmlWriter writer = XmlWriter.Create(Path.Combine(directory, filename));
serializer.Serialize(writer, theObject);
writer.Close();
But the code breaks and it says it cannot serialize the member because its an interface. Anyone know how to do it?
There are no ways to serialize an interface, thus the only way that I can do was, create a translation class for the EF object that I wanted to serialize
For collection members I used arrays like this