Using version 3.5, adapter.
Some of my entities need to hold an instance of another entity, but this relationship is not reflected in the database model since it's a class-level dependency rather than an instance-level dependency.
For example, all instances of EntityA will be holding a reference to an instance of EntityX. All instances of EntityB will be holding a reference to a different instance of EntityX.
EntityX itself has relations to other entities, including possibly other EntityAs and EntityBs.
The EntityAs, EntityBs, etc. get serialized for WCF. On the client side, the client will sometimes need the EntityX that is associated with a particular entity, so I'd like to serialize it along with the EntityA to avoid making a second server call to fetch it later.
I can't, as far as I've been able to figure out, use PerformCustomXmlSerialization, because of infinite recursion problems--working from within PerformCustomXmlSerialization there's no way to track which entities have already been serialized.
I thought about using a model-only relationship so the llblgen framework can handle the serialization fully, but that would require a model-only foreign key field, which isn't supported.
Can anyone think of a way to do this? Or should I just give up make a second server call when I need the EntityX?