.NET XmlSerializer and multiple references to the same object

前端 未结 5 618
你的背包
你的背包 2021-01-05 04:52

My repository has List, List and List where an Enrolment has Enrolment.Student and Enrol

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-05 05:44

    There is no solution for this issue using the XML Serializer. It does not have a concept of identity that it might use to remove duplication.

    The best you can do is to serialize the pool of objects separately from their references. You could then recreate your lists after deserialization.

    BTW, are you aware that the XmlSerializer is not specific to C#?

提交回复
热议问题