Is it possible (this is an EF6 DbContext using CodeFirst) to detect any entities that have been passed to a given data context for saving but are actually attached to a different context?
Entity framework just gives a generic, cannot save because entities are attached to another context error, but doesn't give any information about which entity is attached to a different context. This makes this situation particularly hard to debug.
I know about changeTracker.Entries() (of which I'm not sure these records actually appear in), and I know I can compare the entities of this against the local context to see if they are tracked, but neither of these options seem to allow me to determine whether the entity is being tracked by a different context.