.NET XmlSerializer and multiple references to the same object
问题 My repository has List<Student> , List<Course> and List<Enrolment> where an Enrolment has Enrolment.Student and Enrolment.Course which are references one of the students or courses in the two previous lists. When I use XmlSerializer on my repository it outputs redundant data as it serializes all properties of each student in List<Student> then again for every reference to those same students in List<Enrolment> . I'm looking for an elegant way to solve this. After deserialization I can fix the