AutoMapper, how to keep references between mapped objects?
问题 I am using AutoMapper to convert a UI model to POCOs that I later serialize to XML using a DataContractSerializer in order to preserve the references between them. The problem comes that, when mapping, the references between those entities are lost . The UI classes reference each other, but the mapping process makes new instances for every reference, so the original relations are broken :( Let me explain: I have 2 entities of type Person Person { List<House> OwnedHouses } And these 2 objects