Xml Serialize Interface Typed Members

יום שני, אפריל 30, 2012

If you try to serialize a class that has a public member of an interface type to xml file using the regular .net XmlSerializer, you will get an error: “Cannot serialize member {m} of type {t} because it is an interface.” ({m} and {t} are placeholders). In this post I suggest a workaround to this issue. Consider the following scenario: You have an object model like this: 1: public class Car 2: { ...
תגיות: ,
3 תגובות